#include <bits/stdc++.h>
using namespace std;
struct Seg {
  int l, r, m;
  long long minn;
  Seg* ch[2];
  Seg(int l, int r) : l(l), r(r), m(l + r >> 1) {
    minn = 1ll << 60;
    if (r - l != 1) {
      ch[0] = new Seg(l, m);
      ch[1] = new Seg(m, r);
      pull();
    }
  }
  void pull() { minn = min(ch[0]->minn, ch[1]->minn); };
  void set(int p, long long v) {
    if (r - l == 1) {
      minn = v;
    } else {
      ch[p >= m]->set(p, v);
      pull();
    }
  }
  long long query(int a, int b) {
    if (a >= b) return 0;
    if (a <= l and r <= b) return minn;
    long long ans = 1ll << 60;
    if (a < m) ans = min(ans, ch[0]->query(a, b));
    if (m < b) ans = min(ans, ch[1]->query(a, b));
    return ans;
  }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  string s;
  cin >> n >> k >> s;
  Seg root(0, n + 1);
  vector<pair<int, int> > line[n + 1];
  for (int i = (0); i < (n); i++) {
    if (s[i] == '0') continue;
    line[min(n, i + k + 1)].emplace_back(max(0, i - k), i + 1);
  }
  long long dp[n + 1];
  dp[0] = 0;
  root.set(0, 0);
  for (int i = (1); i < (n + 1); i++) {
    dp[i] = dp[i - 1] + i;
    for (pair<int, int> A : line[i]) {
      dp[i] = min(root.query(A.first, i) + A.second, dp[i]);
    }
    root.set(i, dp[i]);
  }
  cout << dp[n] << endl;
}
