#include <bits/stdc++.h>
using namespace std;
long long dp[200005];
void init(int n) {
  for (int i = 0; i < n; ++i) dp[i] = 1000000000000000000;
  dp[n] = 0;
}
int main() {
  int n, k;
  string s;
  while (cin >> n >> k >> s) {
    int pos[n + 1];
    long long r = 2 * n;
    for (int i = n - 1; i >= -k; --i) {
      if (i >= 0 && s[i] == '1') r = i;
      if (i + k < n) pos[i + k] = r;
    }
    init(n);
    for (int i = n - 1; i >= 0; --i) {
      if (pos[i] - i <= k) {
        long long x = max(0, pos[i] - k);
        dp[x] = min(dp[x], pos[i] + 1 + dp[i + 1]);
      }
      dp[i] = min(dp[i], dp[i + 1] + i + 1);
    }
    cout << dp[0] << endl;
  }
  return 0;
}
