#include using namespace std; int main() { int N, K; string S; cin >> N >> K >> S; for (auto& c : S) c -= '0'; int ans = 0; int free = 0; while (K--) { static int now = 0; if (free) { free--; } else ans++; free += S[now++]; if (now == N) now = 0; } cout << ans << endl; }