#include <bits/stdc++.h>
using namespace std;
using LL = long long;
const LL INF = 10000000000000000L;
class SegTree {
 public:
  SegTree(int _n) : n(_n) {
    x = vector<LL>(_n * 4, INF);
    y = vector<LL>(_n * 4, INF);
  }
  void PushDown(int t, int l, int r) {
    if (l == r) return;
    if (y[t] == INF) return;
    y[t + t] = min(y[t + t], y[t]);
    x[t + t] = min(x[t + t], y[t + t]);
    y[t + t + 1] = min(y[t + t + 1], y[t]);
    x[t + t + 1] = min(x[t + t + 1], y[t + t + 1]);
    y[t] = INF;
  }
  void Insert(int t, LL a, int l, int r, int p, int q) {
    PushDown(t, l, r);
    if (p <= l && r <= q) {
      y[t] = min(y[t], a);
      x[t] = min(x[t], y[t]);
      return;
    }
    int mid = (l + r) >> 1;
    if (p <= mid) Insert(t + t, a, l, mid, p, q);
    if (mid + 1 <= q) Insert(t + t + 1, a, mid + 1, r, p, q);
    x[t] = min(x[t + t], x[t + t + 1]);
  }
  LL Query(int t, int l, int r, int p, int q) {
    PushDown(t, l, r);
    if (p <= l && r <= q) return x[t];
    int mid = (l + r) >> 1;
    LL ans = INF;
    if (p <= mid) ans = min(ans, Query(t + t, l, mid, p, q));
    if (mid + 1 <= q) ans = min(ans, Query(t + t + 1, mid + 1, r, p, q));
    return ans;
  }
  int n;
  vector<LL> x, y;
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  SegTree tree(n + 1);
  string s;
  cin >> s;
  tree.Insert(1, 0, 1, n + 1, 1, 1);
  for (int i = 1; i <= n; ++i) {
    if (s[i - 1] == '0') {
      LL now = tree.Query(1, 1, n + 1, i, i);
      tree.Insert(1, now + i, 1, n + 1, i + 1, i + 1);
    } else {
      int l = max(1, i - k), r = min(n, i + k);
      LL now = tree.Query(1, 1, n + 1, l, i);
      tree.Insert(1, now + i, 1, n + 1, i + 1, r + 1);
    }
  }
  cout << tree.Query(1, 1, n + 1, n + 1, n + 1) << endl;
  return 0;
}
