#include <bits/stdc++.h>
using namespace std;
int main() {
  long k, m;
  string s;
  vector<int> rooms;
  cin >> k >> m;
  cin >> s;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '0') {
      rooms.push_back(i);
    }
  }
  long select = k;
  k = 0;
  while (k + m < rooms.size()) {
    for (int i = k; i <= k + m; i++) {
      if (max(rooms[i] - rooms[k], rooms[k + m] - rooms[i]) < select)
        select = max(rooms[i] - rooms[k], rooms[k + m] - rooms[i]);
    }
    k++;
  }
  cout << select;
}
