#include <bits/stdc++.h>
using namespace std;
int main()
{
vector <long long>old;
long long x,y,sm=0,intsm=0;
cin>>x>>y;
for(int i=0;i<x;i++){
int tm;
cin>>tm;
sm+=tm;
intsm+=tm;
old.push_back(tm);
}
long long rnd=0,ans=0;
while (y>0){
if (y>=sm){
y-=sm;
sm+=intsm;
rnd++;
} else {
if(rnd%2){
int i=x-1;
while (y>=0){
y-=(rnd+1)*old[i];
ans++;
i--;
}
ans--;
} else {
int i=0;
while (y>=0){
y-=(rnd+1)*old[i];
ans++;
i++;
}
ans--;
}
}
}
ans+=rnd*x;
cout<<ans;
return 0;
}