#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100;
int n, k, p[maxn];
char s[maxn];
bool check(int x) {
  for (int i = 1; i <= n; i++)
    if (s[i] == '0') {
      int le = (i - x > 1) ? i - x : 1;
      int ri = (i + x < n) ? i + x : n;
      if (p[ri] - p[le - 1] >= k + 1) {
        return true;
      }
    }
  return false;
}
int main() {
  while (scanf("%d %d", &n, &k) != EOF) {
    scanf("%s", s + 1);
    for (int i = 1; i <= n; i++) {
      p[i] = p[i - 1];
      if (s[i] == '0') p[i]++;
    }
    int l = 0, r = n + 1;
    while (r - l > 1) {
      int mid = (l + r) >> 1;
      if (check(mid))
        r = mid;
      else
        l = mid;
    }
    printf("%d\n", r);
  }
  return 0;
}
