#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int nax = 3e5;
vector<long long> rem[nax];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, k;
  string s;
  cin >> n >> k >> s;
  vector<long long> dp(n + 1, 1e18);
  vector<long long> b;
  multiset<long long> st;
  int at = 0;
  b.push_back(0);
  dp[0] = 0;
  for (long long i = 1; i <= n; i++) {
    dp[i] = min(dp[i], i + dp[i - 1]);
    if (st.size()) {
      dp[i] = min(dp[i], *st.begin());
    }
    while (at < b.size() && b[at] + k + 1 < i) at++;
    if (s[i - 1] == '1') {
      long long cost = i;
      if (at < b.size()) cost += min(dp[i], dp[b[at]]);
      st.insert(cost);
      dp[i] = min(dp[i], cost);
      rem[min(n, i + k)].push_back(cost);
    }
    while (at < b.size() && dp[b[at]] >= dp[i]) b.pop_back();
    for (long long j : rem[i]) st.erase(st.find(j));
    b.push_back(i);
  }
  cout << dp.back() << '\n';
}
