#include <bits/stdc++.h>
using namespace std;
int n, m, k;
char s[100005];
vector<int> cow;
bool check(int x) {
  int i, t;
  for (i = 0; i < m; i++) {
    t = upper_bound(&cow[0], &cow[m], cow[i] + x) -
        lower_bound(&cow[0], &cow[m], cow[i] - x);
    if (t >= k + 1) return true;
  }
  return false;
}
int main() {
  int i, l, r, mid;
  int ans;
  scanf("%d%d %s", &n, &k, s);
  for (i = 0; i < n; i++)
    if (s[i] == '0') cow.push_back(i);
  m = cow.size();
  l = 0;
  r = 100000;
  while (l <= r) {
    mid = (l + r) / 2;
    if (check(mid)) {
      ans = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  printf("%d", ans);
}
