#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
template <typename T, typename E>
struct SegmentTree {
  using F = function<T(T, T)>;
  using G = function<T(T, E, long long)>;
  using H = function<E(E, E)>;
  long long n;
  F f;
  G g;
  H h;
  T ti;
  E ei;
  vector<T> dat;
  vector<E> laz;
  SegmentTree(F f, G g, H h, T ti, E ei) : f(f), g(g), h(h), ti(ti), ei(ei) {}
  void init(long long n_) {
    n = 1;
    while (n < n_) n <<= 1;
    dat.assign((n << 1) - 1, ti);
    laz.assign((n << 1) - 1, ei);
  }
  void build(const vector<T> &v) {
    long long n_ = v.size();
    init(n_);
    for (long long i = 0; i < n_; i++) dat[n + i - 1] = v[i];
    for (long long i = n - 2; i >= 0; i--)
      dat[i] = f(dat[(i << 1) + 2], dat[(i << 1) | 1]);
  }
  void eval(long long k, long long l, long long r) {
    if (laz[k] == ei) return;
    dat[k] = g(dat[k], laz[k], r - l);
    if (r - l > 1) {
      laz[(k << 1) | 1] = h(laz[(k << 1) | 1], laz[k]);
      laz[(k << 1) + 2] = h(laz[(k << 1) + 2], laz[k]);
    }
    laz[k] = ei;
  }
  void update(long long a, long long b, E x, long long k = 0, long long l = 0,
              long long r = -1) {
    if (r < 0) r = n;
    eval(k, l, r);
    if (r <= a || b <= l) return;
    if (a <= l && r <= b) {
      laz[k] = h(laz[k], x);
      eval(k, l, r);
    } else {
      update(a, b, x, (k << 1) | 1, l, (l + r) / 2);
      update(a, b, x, (k << 1) + 2, (l + r) / 2, r);
      dat[k] = f(dat[(k << 1) | 1], dat[(k << 1) + 2]);
    }
  }
  T query(long long a, long long b, long long k = 0, long long l = 0,
          long long r = -1) {
    if (r < 0) r = n;
    eval(k, l, r);
    if (r <= a || b <= l) return ti;
    if (a <= l && r <= b) return dat[k];
    T xl = query(a, b, (k << 1) | 1, l, (l + r) / 2);
    T xr = query(a, b, (k << 1) + 2, (l + r) / 2, r);
    return f(xl, xr);
  }
  template <typename C>
  long long find(long long a, long long b, C &check, T x, long long k = 0,
                 long long l = 0, long long r = -1) {
    if (r < 0) r = n;
    eval(k, l, r);
    if (!check(f(x, dat[k])) || r <= a || b <= l) return -1;
    if (r - l == 1) return l;
    long long xl = find(a, b, check, x, (k << 1) | 1, l, (l + r) / 2);
    if (xl >= 0) return xl;
    x = f(x, dat[(k << 1) | 1]);
    return find(a, b, check, x, (k << 1) + 2, (l + r) / 2, r);
  }
  template <typename C>
  long long find(long long a, long long b, C &check) {
    T x = ti;
    return find(a, b, check, x);
  }
};
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, k;
  string s;
  cin >> n >> k >> s;
  auto f = [](long long a, long long b) { return min(a, b); };
  auto g = [](long long a, long long b, long long len) { return min(a, b); };
  auto h = [](long long a, long long b) { return min(a, b); };
  SegmentTree<long long, long long> seg(f, g, h, (1LL << 60), (1LL << 60));
  seg.build(vector<long long>(n + 1, (1LL << 60)));
  seg.update(0, 1, 0);
  for (long long i = (1); i < (n + 1); ++i) {
    long long l = max(1LL, i - k), r = min(i + k, n + 1) + 1;
    if (s[i - 1] == '0') l = i, r = i + 1;
    seg.update(i, r, seg.query(l - 1, i) + i);
  }
  cout << seg.query(n, n + 1) << endl;
  return 0;
}
