N,K = map(int,raw_input().split()) S = raw_input() need = [0]*(N+1) luck = 0 for i in xrange(N): need[i+1] = need[i] if luck == 0: need[i+1] += 1 else: luck -= 1 luck += int(S[i]) m = K/N if m < 1: print need[K] else: print need[N] if luck >= need[N] else need[N]*m-luck*(m-1) + max(0,need[K%N]-luck)