#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 100;
const int sq = 313;
const long long int inf = 1e17 + 100;
long long int dp[3][N], seg[3][4 * N], mn[N];
void add(int t, int x, long long int val, int b = 0, int e = N, int ind = 1) {
  if (b + 1 == e) {
    seg[t][ind] = val;
    return;
  }
  int mid = (b + e) / 2;
  if (x < mid)
    add(t, x, val, b, mid, ind * 2);
  else
    add(t, x, val, mid, e, ind * 2 + 1);
  seg[t][ind] = min(seg[t][ind * 2], seg[t][ind * 2 + 1]);
}
long long int get(int t, int l, int r, int b = 0, int e = N, int ind = 1) {
  if (r <= b || e <= l) return inf;
  if (l <= b && e <= r) return seg[t][ind];
  int mid = (b + e) / 2;
  return min(get(t, l, r, b, mid, ind * 2), get(t, l, r, mid, e, ind * 2 + 1));
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n, k;
  cin >> n >> k;
  string second;
  cin >> second;
  dp[0][2] = inf;
  add(1, 0, dp[0][2]);
  for (int i = 1; i <= n; i++) {
    dp[1][i] = i + mn[i - 1];
    dp[2][i] = inf;
    if (second[i - 1] == '1') dp[2][i] = i + get(0, max(0, i - k - 1), i);
    dp[0][i] = get(1, max(0, i - k), i);
    mn[i] = min(min(dp[1][i], dp[0][i]), dp[2][i]);
    add(0, i, mn[i]);
    add(1, i, dp[2][i]);
  }
  cout << mn[n] << endl;
  return 0;
}
