#include <bits/stdc++.h>
using namespace std;
const long long N = 4e5 + 5;
long long t = 1;
vector<long long> dp(N);
void solve() {
  long long n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  s = '$' + s;
  set<pair<long long, long long> > seta_univ, seta_router;
  for (long long i = n; i >= 1; i--) {
    while (!seta_univ.empty() and (*seta_univ.begin()).second - i > k) {
      seta_univ.erase(seta_univ.begin());
    }
    while (!seta_router.empty() and (*seta_router.begin()).second - i > k) {
      seta_router.erase(seta_router.begin());
    }
    if (s[i] == '1') {
      if (!seta_univ.empty()) {
        dp[i] = i + min(dp[i + k + 1], (*seta_univ.begin()).first);
      } else
        dp[i] = i + dp[i + k + 1];
      seta_router.insert({dp[i], i});
    } else
      dp[i] = i + dp[i + 1];
    if (!seta_router.empty()) dp[i] = min(dp[i], (*seta_router.begin()).first);
    seta_univ.insert({dp[i], i});
  }
  cout << dp[1] << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  while (t--) {
    solve();
  }
  return 0;
}
