#include <bits/stdc++.h>
using namespace std;
long long n, k;
vector<long long> pref(100005), a(100005);
bool ans(long long mx) {
  for (long long i = 1; i <= n; i++) {
    if (a[i] == 1) {
      long long x = pref[min(n, i + mx)] - pref[i];
      long long y =
          pref[max((long long)0, i - 1)] - pref[max((long long)0, i - mx - 1)];
      if (x + y >= k) return true;
    }
  }
  return false;
}
signed main() {
  long long tt = 0;
  string s;
  cin >> n >> k;
  cin >> s;
  for (long long i = 0; i < s.length(); i++) {
    if (s[i] == '0') a[i + 1]++;
  }
  for (long long i = 1; i <= n; i++) {
    pref[i] = pref[i - 1] + a[i];
  }
  long long start = 1, end = n;
  while (start <= end) {
    long long mid = (start + end) / 2;
    if (ans(mid) == true) {
      tt = mid;
      end = mid - 1;
    } else
      start = mid + 1;
  }
  cout << tt;
}
