#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  vector<long long int> v;
  for (long long int i = 0; i < n; i++) {
    if (s[i] == '0') v.push_back(i + 1);
  }
  long long int j = 0;
  long long int c = 1e9;
  for (long long int i = k; i < v.size(); i++) {
    long long int l = j, u = i;
    c = min(c, abs(v[j] - v[i]));
    while (l <= u) {
      long long int mid = (l + u) / 2;
      long long int a = abs(v[j] - v[mid]);
      long long int b = abs(v[mid] - v[i]);
      c = min(c, max(a, b));
      if (a >= b) {
        u = mid - 1;
      } else {
        l = mid + 1;
      }
    }
    j++;
  }
  cout << c;
}
