#include <bits/stdc++.h>
using namespace std;
const int MAXN = 260;
const int MOD = (int)(1e9) + 7;
using ll = long long;
int main() {
  ios_base::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  multiset<long long> choices;
  multiset<long long> sofar{0LL};
  queue<pair<int, ll> > last_few;
  vector<long long> dp(n + 1);
  for (int i = n - 1; i >= 0; i--) {
    if (i <= n - k - 2) {
      long long nope = dp[i + k + 2];
      sofar.erase(sofar.find(nope));
    }
    if (s[i] == '1') {
      long long cst = *sofar.begin() + i + 1;
      choices.insert(cst);
      last_few.emplace(i, cst);
    }
    while (!last_few.empty() && last_few.front().first - i > k) {
      auto rem = last_few.front().second;
      choices.erase(choices.find(rem));
      last_few.pop();
    }
    long long opt = choices.empty() ? (long long)(1e15) : *choices.begin();
    dp[i] = min(i + 1 + dp[i + 1], opt);
    sofar.insert(dp[i]);
  }
  cout << dp[0] << '\n';
  return 0;
}
