#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
int a[200000];
int n, k;
bool check(int x) {
  int ind(0);
  for (int i(0); i < k - 1; i++) {
    ind += x;
    if (ind >= n - 1) return 1;
    ind = a[ind];
  }
  return 0;
}
bool solve() {
  cin >> n >> k;
  for (int i(0), last(0); i < n; i++) {
    char t;
    cin >> t;
    if (t == '1')
      a[i] = last;
    else {
      a[i] = i;
      last = i;
    }
  }
  int l(0), r(n), m(0);
  while (r - l > 1) {
    m = (r + l) / 2;
    if (check(m))
      r = m;
    else
      l = m;
  }
  if (check(l))
    cout << l - 1;
  else
    cout << r - 1;
  return 1;
}
int main() {
  solve();
  return 0;
}
