#include <bits/stdc++.h>
using namespace std;
bool comp(long long x, long long y) { return x > y; }
int dx[] = {0, 0, 1, -1, 1, 1, -1, -1};
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
int n, k;
char s[100000 + 5];
int prefix[100000 + 5];
bool check(int x, int i) {
  int tmp = prefix[min(n - 1, i + x)];
  if (i - x > 0) tmp -= prefix[i - x - 1];
  if (tmp >= k + 1) return true;
  return false;
}
int main() {
  cin >> n >> k;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (i != 0) prefix[i] = prefix[i - 1];
    prefix[i] += (s[i] == '0');
  }
  int res = 1e9;
  for (int i = 0; i < n; i++) {
    int ans = 1e9;
    if (s[i] == '0') {
      int l = 0, r = 1e9;
      while (l != r) {
        int mid = (l + r - 1) / 2;
        if (check(mid, i)) {
          r = mid;
          ans = min(ans, mid);
        } else
          l = mid + 1;
      }
      res = min(res, ans);
    }
  }
  cout << res << endl;
  return 0;
}
