#include <bits/stdc++.h>
using namespace std;
long long n, k;
string ss;
set<pair<long long, long long> > s;
multiset<long long> past;
vector<long long> dp;
int main() {
  cin >> n >> k;
  dp.resize(n + 1, 0);
  past.insert(0);
  cin >> ss;
  ss = '0' + ss;
  for (int i = 1; i <= n; i++) {
    if (i > k + 1) past.erase(past.find(dp[i - k - 2]));
    while (!s.empty() && s.begin()->second < i) s.erase(s.begin());
    if (!s.empty())
      dp[i] = s.begin()->first;
    else
      dp[i] = dp[i - 1] + i;
    if (ss[i] == '1') {
      s.insert({*past.begin() + i, i + k});
      dp[i] = min(dp[i], *past.begin() + i);
    }
    past.insert(dp[i]);
  }
  cout << dp[n];
  return 0;
}
