#include <bits/stdc++.h>
using namespace std;
template <class Monoid, class Action>
struct SegTree {
  using FuncMonoid = function<Monoid(Monoid, Monoid)>;
  using FuncAction = function<void(Monoid &, Action)>;
  using FuncLazy = function<void(Action &, Action)>;
  FuncMonoid FM;
  FuncAction FA;
  FuncLazy FL;
  Monoid UNITY_MONOID;
  Action UNITY_LAZY;
  int SIZE, HEIGHT;
  vector<Monoid> dat;
  vector<Action> lazy;
  SegTree() {}
  SegTree(int n, const FuncMonoid fm, const FuncAction fa, const FuncLazy fl,
          const Monoid &unity_monoid, const Action &unity_lazy)
      : FM(fm),
        FA(fa),
        FL(fl),
        UNITY_MONOID(unity_monoid),
        UNITY_LAZY(unity_lazy) {
    SIZE = 1;
    HEIGHT = 0;
    while (SIZE < n) SIZE <<= 1, ++HEIGHT;
    dat.assign(SIZE * 2, UNITY_MONOID);
    lazy.assign(SIZE * 2, UNITY_LAZY);
  }
  void init(int n, const FuncMonoid fm, const FuncAction fa, const FuncLazy fl,
            const Monoid &unity_monoid, const Action &unity_lazy) {
    FM = fm;
    FA = fa;
    FL = fl;
    UNITY_MONOID = unity_monoid;
    UNITY_LAZY = unity_lazy;
    SIZE = 1;
    HEIGHT = 0;
    while (SIZE < n) SIZE <<= 1, ++HEIGHT;
    dat.assign(SIZE * 2, UNITY_MONOID);
    lazy.assign(SIZE * 2, UNITY_LAZY);
  }
  void set(int a, const Monoid &v) { dat[a + SIZE] = v; }
  void build() {
    for (int k = SIZE - 1; k > 0; --k) dat[k] = FM(dat[k * 2], dat[k * 2 + 1]);
  }
  inline void evaluate(int k) {
    if (lazy[k] == UNITY_LAZY) return;
    if (k < SIZE) FL(lazy[k * 2], lazy[k]), FL(lazy[k * 2 + 1], lazy[k]);
    FA(dat[k], lazy[k]);
    lazy[k] = UNITY_LAZY;
  }
  inline void update(int a, int b, const Action &v, int k, int l, int r) {
    evaluate(k);
    if (a <= l && r <= b)
      FL(lazy[k], v), evaluate(k);
    else if (a < r && l < b) {
      update(a, b, v, k * 2, l, (l + r) >> 1),
          update(a, b, v, k * 2 + 1, (l + r) >> 1, r);
      dat[k] = FM(dat[k * 2], dat[k * 2 + 1]);
    }
  }
  inline void update(int a, int b, const Action &v) {
    update(a, b, v, 1, 0, SIZE);
  }
  inline Monoid get(int a, int b, int k, int l, int r) {
    evaluate(k);
    if (a <= l && r <= b)
      return dat[k];
    else if (a < r && l < b)
      return FM(get(a, b, k * 2, l, (l + r) >> 1),
                get(a, b, k * 2 + 1, (l + r) >> 1, r));
    else
      return UNITY_MONOID;
  }
  inline Monoid get(int a, int b) { return get(a, b, 1, 0, SIZE); }
  inline Monoid operator[](int a) { return get(a, a + 1); }
  void print() {
    for (int i = 0; i < SIZE; ++i) {
      cout << (*this)[i];
      if (i != SIZE) cout << ",";
    }
    cout << endl;
  }
};
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(20);
  long long n, k;
  string s;
  cin >> n >> k >> s;
  long long INF = 1e15;
  auto fm = [](long long a, long long b) { return min(a, b); };
  auto fa = [](long long &a, long long d) { a = min(a, d); };
  auto fl = [](long long &d, long long e) { d = min(d, e); };
  SegTree<long long, long long> seg(n + 2, fm, fa, fl, INF, INF);
  reverse(s.begin(), s.end());
  seg.update(0, 1, 0);
  for (int i = 0; i < n; i++) {
    long long t = seg.get(i + 1, i + 2);
    seg.update(i + 1, i + 2, seg.get(i, i + 1) + n - i);
    if (s[i] == '1') {
      seg.update(max(1LL, (long long)i + 1 - k),
                 min((long long)i + 2 + k, n + 1),
                 seg.get((long long)max(0LL, (long long)i - k),
                         (long long)max(0LL, (long long)i - k) + 1) +
                     n - i);
    }
  }
  cout << seg.get(n, n + 1) << endl;
}
