n,k=map(int,input().split())
s=input()

u=max(len(s)-sum(map(int,s)),0)

cost=0
prize=0
if n<k:
    for c in s:
        if prize>0: prize-=1
        else:       cost+=1
        if c!="0":  prize+=int(c)
    cost+=((k-1)//n-1)*u

for c in s[:(k-1)%n+1]:
    if prize>0: prize-=1
    else:       cost+=1
    if c!="0":  prize+=int(c)

print(cost)