N, K = map(int, raw_input().split()) S = raw_input() ans = 0 free = 0 eaten = 0 while True: for i in xrange(len(S)): if free > 0: free -= 1 else: ans += 1 eaten += 1 free += int(S[i]) if eaten == K: print ans exit() if free > 0: print ans exit()