#include <bits/stdc++.h>
using namespace std;
template <class T>
struct SegmentTree {
  typedef function<T(T, T)> F;
  int n;
  F f;
  T unit;
  vector<T> dat;
  SegmentTree(){};
  SegmentTree(int newn, F f, T t) : f(f), unit(t) { init(newn); }
  SegmentTree(const vector<T> &v, F f, T t) : f(f), unit(t) {
    int _n = v.size();
    init(v.size());
    for (int i = 0; i < _n; ++i) dat[n + i] = v[i];
    for (int i = n - 1; i; --i) dat[i] = f(dat[i << 1], dat[(i << 1) | 1]);
  }
  void init(int newn) {
    n = 1;
    while (n < newn) n <<= 1;
    dat.assign(n << 1, unit);
  }
  void update(int k, T newdata) {
    dat[k += n] = newdata;
    while (k >>= 1) {
      dat[k] = f(dat[(k << 1) | 0], dat[(k << 1) | 1]);
    }
  }
  T query(int a, int b) {
    T vl = unit, vr = unit;
    for (int l = a + n, r = b + n; l < r; l >>= 1, r >>= 1) {
      if (l & 1) vl = f(vl, dat[l++]);
      if (r & 1) vr = f(dat[--r], vr);
    }
    return f(vl, vr);
  }
};
struct data {
  long long l, r, cos;
};
long long n, k;
string s;
vector<data> v;
SegmentTree<long long> dp;
long long solve();
int main() {
  cin >> n >> k >> s;
  cout << solve() << endl;
  return 0;
}
long long solve() {
  auto f = [](long long l, long long r) { return min(l, r); };
  dp = SegmentTree<long long>(n + 1, f, (long long)(1e18));
  dp.update(0, 0);
  for (int i = 0; i < n; ++i)
    if (s[i] == '1') v.push_back({max(0LL, i - k), min(n - 1, i + k), i + 1});
  long long id = 0, vsize = v.size();
  for (int i = 0; i < n; ++i) {
    long long now = dp.query(i, i + 1) + i + 1;
    while (id < vsize && v[id].r == i) {
      now = min(now, dp.query(v[id].l, v[id].r + 1) + v[id].cos);
      ++id;
    }
    dp.update(i + 1, now);
  }
  return dp.query(n, n + 1);
}
