#include <bits/stdc++.h>
const double EPS = 1e-24;
const long long mod = 1000000007ll;
const long long mod1 = 1000000009ll;
const long long mod2 = 1100000009ll;
const double PI = 3.14159265359;
int INF = 2147483640;
long long INFINF = 9223372036854775807;
template <class T>
T Max2(T a, T b) {
  return a < b ? b : a;
}
template <class T>
T Min2(T a, T b) {
  return a < b ? a : b;
}
template <class T>
T Max3(T a, T b, T c) {
  return Max2(Max2(a, b), c);
}
template <class T>
T Min3(T a, T b, T c) {
  return Min2(Min2(a, b), c);
}
template <class T>
T Max4(T a, T b, T c, T d) {
  return Max2(Max2(a, b), Max2(c, d));
}
template <class T>
T Min4(T a, T b, T c, T d) {
  return Min2(Min2(a, b), Max2(c, d));
}
using namespace std;
long long bit_count(long long _x) {
  long long _ret = 0;
  while (_x) {
    if (_x % 2 == 1) _ret++;
    _x /= 2;
  }
  return _ret;
}
long long bit(long long _mask, long long _i) {
  return (_mask & (1 << _i)) == 0 ? 0 : 1;
}
long long powermod(long long _a, long long _b, long long _m) {
  long long _r = 1;
  while (_b) {
    if (_b % 2 == 1) _r = (_r * _a) % _m;
    _b /= 2;
    _a = (_a * _a) % _m;
  }
  return _r;
}
long long add(long long a, long long b, long long m) {
  long long x = a + b;
  while (x >= m) x -= m;
  return x;
}
long long sub(long long a, long long b, long long m) {
  long long x = a - b;
  while (x < 0) x += m;
  return x;
}
long long mul(long long a, long long b, long long m) {
  long long x = a * b;
  x %= m;
  return x;
}
void swap(int &a, int &b) {
  a = a ^ b;
  b = a ^ b;
  a = a ^ b;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k;
  vector<int> a;
  cin >> n >> k;
  string s;
  cin >> s;
  for (int i = 0; i < int(s.length()); i++) {
    if (s[i] == '0') a.push_back(i + 1);
  }
  int l = a[0], r = a[k], m = 0;
  int b = 0, dis = 0, Min = INF;
  for (int j = 0; j < a.size() - k; j++) {
    l = a[j];
    r = a[j + k];
    while (Max2(r - a[b + 1], a[b + 1] - l) < Max2(r - a[b], a[b] - l)) {
      b++;
    }
    Min = Min2(Max2(r - a[b], a[b] - l), Min);
  }
  if (Min == INF) Min = 1;
  cout << Min;
}
