#include using namespace std; int main() { int n, k; cin>>n>>k; string s; cin>>s; int buy=0, win=0; while (k>0) { for(auto& c: s) { win==0 ? buy++ : win--; win+=c-'0'; k--; if (k==0) return !printf("%d\n", buy); } if (win==0) { buy+=k/n*buy; k%=n; } if (win>=n) k=0; } printf("%d\n", buy); }