#include <bits/stdc++.h>
using namespace std;
char s[200005];
int n, k;
long long f[200005], tree[1000005];
void pushup(int o) { tree[o] = min(tree[o << 1], tree[o << 1 | 1]); }
void update(int o, int l, int r, int p, long long v) {
  if (l == r) {
    tree[o] = v;
    return;
  }
  if (p <= (l + r) / 2)
    update(o << 1, l, (l + r) / 2, p, v);
  else
    update(o << 1 | 1, (l + r) / 2 + 1, r, p, v);
  pushup(o);
}
long long ask(int o, int l, int r, int from, int to) {
  if (l >= from && r <= to) return tree[o];
  long long ans = 1e18;
  if (from <= (l + r) / 2)
    ans = min(ans, ask(o << 1, l, (l + r) / 2, from, to));
  if (to > (l + r) / 2)
    ans = min(ans, ask(o << 1 | 1, (l + r) / 2 + 1, r, from, to));
  return ans;
}
int main() {
  memset(tree, 0x3f, sizeof(tree));
  memset(f, 0x3f, sizeof(f));
  scanf("%d%d", &n, &k);
  scanf("%s", s + 1);
  f[0] = 0;
  update(1, 0, n, 0, 0);
  for (int i = 1; i <= n; i++) {
    if (s[i] == '0')
      f[i] = min(f[i], f[i - 1] + i);
    else
      f[min(i + k, n)] =
          min(f[min(i + k, n)], ask(1, 0, n, max(i - k - 1, 0), n) + i);
    update(1, 0, n, min(i + k, n), f[min(i + k, n)]);
    f[i] = min(f[i], ask(1, 0, n, i + 1, n));
    update(1, 0, n, i, f[i]);
  }
  printf("%lld\n", f[n]);
  return 0;
}
