#include <bits/stdc++.h>
using namespace std;
vector<int> p;
int n, k;
char s[100005];
bool foo(int d) {
  for (int x : p) {
    int l = lower_bound(p.begin(), p.end(), x - d) - p.begin();
    int r = lower_bound(p.begin(), p.end(), x + d + 1) - p.begin();
    if (r - l >= k + 1) return true;
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> k;
  cin >> s;
  for (int i = 0; i < n; ++i)
    if (s[i] == '0') p.push_back(i);
  int st = 0, en = 200005, b = 200005;
  while (st <= en) {
    int md = (st + en) / 2;
    if (foo(md)) {
      b = md;
      en = md - 1;
    } else {
      st = md + 1;
    }
  }
  printf("%d\n", b);
}
