#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k, dp[200005];
  priority_queue<
      pair<long long int, pair<long long int, long long int> >,
      vector<pair<long long int, pair<long long int, long long int> > >,
      greater<pair<long long int, pair<long long int, long long int> > > >
      pq;
  pair<long long int, pair<long long int, long long int> > u;
  char s[200005];
  scanf("%lld %lld %s", &n, &k, s);
  for (long long int i = 0; i < n; i++)
    if (s[i] == '1')
      pq.push(
          make_pair(i + 1, make_pair(max(1ll, i + 1 - k), min(n, i + 1 + k))));
  dp[0] = 0;
  for (long long int i = 1; i <= n; i++) {
    dp[i] = dp[i - 1] + i;
    if (pq.empty()) continue;
    u = pq.top();
    if (u.second.second < i) {
      pq.pop();
      if (pq.empty()) continue;
      u = pq.top();
    }
    if (u.second.first <= i)
      dp[i] = min(dp[i], dp[u.second.first - 1] + u.first);
  }
  printf("%lld\n", dp[n]);
  return 0;
}
