#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
const long long LL_MAX = 0x7fffffffffffffff - 0x3f3f3f3f;
inline long long min(long long a, long long b) { return a < b ? a : b; }
inline long long min(long long a, long long b, long long c) {
  return min(min(a, b), c);
}
inline long long min(long long a, long long b, long long c, long long d) {
  return min(min(a, b), min(c, d));
}
long long f[N][2];
char c[N];
int n, k;
struct Node {
  int l, r;
  long long mi;
} tr[N << 2];
inline void pushup(int u) {
  tr[u].l = tr[u << 1].l, tr[u].r = tr[u << 1 | 1].r;
  tr[u].mi = min(tr[u << 1].mi, tr[u << 1 | 1].mi);
}
void build(int u, int l, int r) {
  if (l == r)
    tr[u] = {l, r, LL_MAX};
  else {
    int m = l + r >> 1;
    build(u << 1, l, m), build(u << 1 | 1, m + 1, r);
    pushup(u);
  }
}
void modify(int u, int x, long long c) {
  if (tr[u].l == tr[u].r)
    tr[u].mi = c;
  else {
    int m = tr[u].l + tr[u].r >> 1;
    if (x <= m)
      modify(u << 1, x, c);
    else
      modify(u << 1 | 1, x, c);
    pushup(u);
  }
}
long long query(int u, int l, int r) {
  if (l <= tr[u].l && tr[u].r <= r)
    return tr[u].mi;
  else {
    int m = tr[u].l + tr[u].r >> 1;
    long long res = LL_MAX;
    if (l <= m) res = min(res, query(u << 1, l, r));
    if (m < r) res = min(res, query(u << 1 | 1, l, r));
    return res;
  }
}
int main() {
  scanf("%d%d", &n, &k);
  cin >> c + 1;
  build(1, 1, n);
  f[1][0] = LL_MAX, f[1][1] = 1;
  if (c[1] == '1') modify(1, 1, 1);
  for (int i = 2; i <= n; i++) {
    f[i][1] = min(f[i - 1][0], f[i - 1][1]) + i;
    if (c[i] == '1') {
      f[i][1] = min(f[i][1], f[max(0, i - k - 1)][1] + i,
                    f[max(0, i - k - 1)][0] + i);
      modify(1, i, f[i][1]);
    }
    f[i][0] = query(1, max(1, i - k), i - 1);
  }
  cout << min(f[n][1], f[n][0]) << endl;
  return 0;
}
