#include <bits/stdc++.h>
using namespace std;
int k, n, a[100009], cnt = 0, ans = 1e9;
bool check(int i, int mid) {
  int first = 0;
  if (i - mid - 1 >= 0) first = a[i - mid - 1];
  if (a[min(mid + i, n - 1)] - first >= k + 1) return true;
  return false;
}
int main() {
  string s;
  cin >> n >> k;
  cin >> s;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '0') cnt++;
    a[i] = cnt;
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '1') continue;
    int first = 0, last = n - 1, mid, res = 1e9;
    while (first <= last) {
      mid = (first + last) / 2;
      if (check(i, mid) == true) {
        last = mid - 1;
        res = min(res, mid);
      } else
        first = mid + 1;
    }
    ans = min(ans, res);
  }
  cout << ans;
  return 0;
}
