def check(K): ret = 0 cnt = 0 for i in range(K): if cnt == 0: ret += 1 else: cnt -= 1 cnt += S[i] return cnt, ret N,K = map(int,input().split()) S = list(map(int,input())) if K <= N: _,ans = check(K) print(ans) else: cnt,buy = check(N) if buy < cnt: print(buy) else: _,ans = check(max(0, K%N-cnt)) print(buy + (buy-cnt) * (K//N-1) + ans)