n,e = map(int,input().split()) a = list(map(int,input())) buy = 0 count = 0 bonus = 0 for i in range(e): if count == e: break for j in range(n): count += 1 if bonus == 0: buy +=1 else: bonus -= 1 bonus += a[j] if count == e: break print(buy)