N,K=map(int,raw_input().split()) S=raw_input() dp=[0 for i in range(2*N+1)] rest=0 prev=0 for i in range(1,2*N+1): if rest == 0: dp[i]=dp[i-1]+1 rest += ord(S[(i-1)%N])-ord("0") else: rest-=1 dp[i]=dp[i-1] rest += ord(S[(i-1)%N])-ord("0") #print dp[(K-1)%N+1],((K-(K-1)%N-1)/N),(dp[(K-1)%N+1+N]-dp[(K-1)%N+1]) print dp[(K-1)%N+1]+((K-(K-1)%N-1)/N)*(dp[(K-1)%N+1+N]-dp[(K-1)%N+1])