#yuki_78 n,k=map(int,raw_input().split()) s=raw_input() res=0 point=cost=0 if k>n: for i in xrange(n): if point==0: cost+=1 else: point-=1 point+=int(s[i]) res+=cost k=k-n res+=k/n*max(cost-point,0) cost2=0 point2=point for i in xrange(k%n): if point2==0: cost2+=1 else: point2-=1 point2+=int(s[i]) res+=cost2 print res