#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 10, MAX = 2e5 + 1e4, MOD = 1e9 + 7;
void OUT(long double o, int x) {
  cout << fixed << setprecision(x) << o;
  return;
}
long long a[MAX];
vector<int> v;
int bs(int s, int e, int x, int y) {
  if (s == e) return max(v[s] - x, y - v[s]);
  int m = (s + e) / 2;
  if (max(v[m] - x, y - v[m]) < max(v[m + 1] - x, y - v[m + 1]))
    return bs(s, m, x, y);
  else if (max(v[m] - x, y - v[m]) > max(v[m + 1] - x, y - v[m + 1]))
    return bs(m + 1, e, x, y);
  return max(v[m] - x, y - v[m]);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  string s;
  cin >> n >> k >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '0') v.push_back(i);
  }
  int x = INF;
  for (int i = k; i < v.size(); i++) x = min(x, bs(i - k, i, v[i - k], v[i]));
  cout << x;
  return 0;
}
