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]) if luck >= need[N]: print 1 else: m = K/N print need[K] if m < 1 else need[N]*m-luck*(m-1) + max(0,need[K%N]-luck)