#include #include #include #include #include #include #include #include #define rep(x,to) for(int (x)=0;(x)<(to);(x)++) using namespace std; typedef long long ll; int main() { int n, k; string s; cin >> n >> k >>s; int at=0, res=0; rep(i,n) at += s[i]-'0'; int wt = max(0, (k-5000)/n); res = max(0, wt * (n-at)); at =0; k -= n * wt; while(k>0){ rep(i,n){ if(at>0) at--; else res++; k--; if(k < 1) break; at += s[i] -'0'; } } cout << res << endl; return 0; }