import java.util.ArrayList; import java.util.HashSet; import java.util.Scanner; public class Main { static int N, K; static String S; static private void solve() { int buybar = 0; int nextbar = 0; int freebar = 0; for (int k = 1; k <= K; k++) { if (freebar > 0) freebar--; else buybar++; switch (S.charAt(nextbar)) { case '0': break; case '1': freebar++; break; case '2': freebar+=2; break; } nextbar++; if (nextbar == N) { nextbar = 0; } } System.out.println(buybar); } static public void main(String[] args) { Scanner sca = new Scanner(System.in); N = sca.nextInt(); K = sca.nextInt(); S = sca.next(); solve(); } }