package no078; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); char[] s = sc.next().toCharArray(); Pair[] bef = new Pair[n]; int bought = 0; int eaten = 0; int index = 0; boolean naive = false; while(true) { if (!naive && bef[index] != null) { int d = eaten - bef[index].eaten; int units = (k-eaten) / d; eaten += units * d; bought += units * (bought - bef[index].bought); naive = true; if (eaten >= k) { break; } } if (!naive) { bef[index] = new Pair(bought,eaten); } bought++; int atari = 1; for(int i=0;i<=n;i++) { atari--; eaten++; atari += s[index] - '0'; index = (index + 1) % n; if (atari == 0) { break; } if (i == n) { eaten = k; } } if (eaten >= k) { break; } } System.out.println(bought); } static class Pair { int bought,eaten; public Pair(int bought,int eaten) { this.bought = bought; this.eaten = eaten; } } }