#include <bits/stdc++.h>
using namespace std;
signed main() {
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  vector<long long> dp(n + 1);
  vector<int> R(n + 1, n);
  for (int i = n - 1; i > -1; i--) {
    if (s[i] == '1')
      R[i] = i;
    else
      R[i] = R[i + 1];
  }
  dp[0] = 0;
  for (int i = 1; i <= n; i++) {
    dp[i] = dp[i - 1] + i;
    int j = R[max(0, i - k - 1)];
    if (j < n && j - k < i) dp[i] = min(dp[i], j + 1 + dp[max(0, j - k)]);
  }
  cout << dp[n] << endl;
}
