#include <bits/stdc++.h>
using namespace std;
int read() {
  int res = 0, w = 1;
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-') c = getchar(), w = -1;
  while (isdigit(c)) res = (res << 1) + (res << 3) + c - '0', c = getchar();
  return res * w;
}
const int N = 3e5 + 10;
const long long INF = 1e16;
long long tag[N << 2];
void build(int t, int l, int r) {
  tag[t] = (l == 0) ? 0 : INF;
  if (l == r) return;
  int mid = (l + r) >> 1;
  build((t << 1), l, mid);
  build((t << 1 | 1), mid + 1, r);
}
void modify(int t, int l, int r, int pos, long long vl) {
  tag[t] = min(tag[t], vl);
  if (l == r) return;
  int mid = (l + r) >> 1;
  if (pos <= mid)
    modify((t << 1), l, mid, pos, vl);
  else
    modify((t << 1 | 1), mid + 1, r, pos, vl);
}
long long query(int t, int l, int r, int ql, int qr) {
  if (ql <= l && r <= qr) {
    return tag[t];
  }
  int mid = (l + r) >> 1;
  long long res = INF;
  if (ql <= mid) res = min(res, query((t << 1), l, mid, ql, qr));
  if (qr > mid) res = min(res, query((t << 1 | 1), mid + 1, r, ql, qr));
  return res;
}
char s[N];
int n, k;
int main() {
  n = read(), k = read();
  scanf("%s", s + 1);
  build(1, 0, n);
  for (int i = 1; i <= n; i++) {
    if (s[i] == '1') {
      modify(1, 0, n, min(n, i + k), query(1, 0, n, max(1, i - k) - 1, n) + i);
    }
    modify(1, 0, n, i, query(1, 0, n, i - 1, i - 1) + i);
  }
  cout << query(1, 0, n, n, n) << endl;
  return 0;
}
