#include <bits/stdc++.h>
using namespace std;
long long n, k, v[200010], arbint[800010];
const long long inf = 100000000000000;
void upd(int nod, int left, int right, int pos, long long val) {
  int middle = (left + right) / 2;
  if (left == right) {
    if (val == inf)
      arbint[nod] = val;
    else
      arbint[nod] = min(arbint[nod], val);
    return;
  }
  if (pos <= middle)
    upd(2 * nod, left, middle, pos, val);
  else
    upd(2 * nod + 1, middle + 1, right, pos, val);
  arbint[nod] = min(arbint[2 * nod], arbint[2 * nod + 1]);
}
long long query(int nod, int left, int right, int L, int R) {
  if (L <= 0) return 0;
  int middle = (left + right) / 2;
  if (left > R || right < L) return inf;
  if (L <= left && right <= R) return arbint[nod];
  return min(query(2 * nod, left, middle, L, R),
             query(2 * nod + 1, middle + 1, right, L, R));
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    char c;
    cin >> c;
    v[i] = c - '0';
    upd(1, 1, n, i, inf);
  }
  for (int i = 1; i <= n; i++) {
    upd(1, 1, n, i, query(1, 1, n, i - 1, i - 1) + i);
    if (v[i] == 1) {
      upd(1, 1, n, min(i + k, n), query(1, 1, n, i - k - 1, i + k) + i);
    }
  }
  cout << query(1, 1, n, n, n);
  return 0;
}
