#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100000;
const int INF = 1 << 30;
char s[MAX_N + 4];
int as[MAX_N];
inline int dist(int l, int r, int i) {
  return max(as[i] - as[l], as[r] - as[i]);
}
int main() {
  int n, k;
  scanf("%d%d%s", &n, &k, s);
  int m = 0;
  for (int i = 0; i < n; i++)
    if (s[i] == '0') as[m++] = i;
  int mind = INF;
  for (int l = 0, r = k, i = 0; r < m; l++, r++) {
    if (i < l) i = l;
    int d0 = dist(l, r, i), d1;
    while (i < r && d0 > (d1 = dist(l, r, i + 1))) i++, d0 = d1;
    if (mind > d0) mind = d0;
  }
  printf("%d\n", mind);
  return 0;
}
