#include <bits/stdc++.h>
using namespace std;
long long n, k, a[100005];
string s;
int main() {
  cin >> n >> k >> s;
  for (int i = 0; i < s.size(); i++) {
    a[i + 1] = a[i] + (s[i] == '0');
  }
  long long l = 0, r = n, mid;
  k++;
  while (r - l > 1) {
    mid = (l + r) / 2;
    bool ok = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == '1') continue;
      ok = a[min(n, i + 1 + mid)] - a[max((long long)0, i - mid)] >= k;
      if (ok) break;
    }
    if (ok)
      r = mid;
    else
      l = mid;
  }
  cout << r << endl;
  return 0;
}
