#include <bits/stdc++.h>
using namespace std;
vector<long long> pr;
string s;
bool check(long long x, long long k) {
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '0') continue;
    long long a = pr[min((long long)s.size(), i + x + 1)];
    long long b = pr[max((long long)0, i - x)];
    if (a - b >= k) return true;
  }
  return false;
}
int main() {
  long long n, k;
  cin >> n >> k >> s;
  k++;
  for (int i = 0; i < s.size(); i++) {
    s[i] = '1' + '0' - s[i];
  }
  pr.push_back(0);
  for (int i = 0; i < s.size(); i++) {
    pr.push_back(pr[i] + s[i] - '0');
  }
  long long l = 1, r = s.size() + 1;
  while (r - l > 1) {
    long long m = (l + r) >> 1;
    if (check(m, k)) {
      if (check(m - 1, k)) {
        r = m;
      } else {
        break;
      }
    } else {
      l = m;
    }
  }
  long long m = (r + l) >> 1;
  if (check(m - 1, k)) m--;
  cout << m << endl;
}
