#include <iostream>
#include<bits/stdc++.h>

using namespace std;


bool check(vector<int> &arr,int mid,int m){
	
	int n = arr.size();
	vector<int> temp(n+1,0);
	
	for(int i=1;i<=n;i++){
		int a = i*mid + arr[i];
		temp[i]=a;
	}
	
	sort(temp.begin()+1,temp.end());
	int sum=0;
	
	for(int i=1;i<=mid;i++){
		sum+=temp[i];
		
	}
	
	return sum<=m;
	
}
int main() {
	// your code goes here
	int n,m;
	cin>>n>>m;
	vector<int> arr(n+1,0);
	int low=0;
	int high=n;
	
	for(int i=1;i<=n;i++){
		cin>>arr[i];
	}
	int ans=0;
	
	while(low<=high){
		int mid=(low+high)/2;
		
		if(check(arr,mid,m)==true){
			ans=mid;
			low=mid+1;
			
		}
		else{
			high=mid-1;
			
		}
	}
	
	cout<<ans<<endl;
	
	
	return 0;
}