#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, j, m, t, n, k;
  string s;
  cin >> n >> k;
  cin >> s;
  long long int dp[n + 1];
  for (i = 0; i <= n; i++) dp[i] = LLONG_MAX;
  dp[n] = 0;
  long long int prev[n];
  list<long long int> q;
  for (i = 0; i < n; i++) {
    if (s[i] == '1') q.push_back(i);
    if (q.size() > 0 and q.front() < i - k) q.pop_front();
    if (q.size() > 0)
      prev[i] = q.front();
    else
      prev[i] = INT_MAX;
  }
  q.clear();
  for (i = n - 1; i >= 0; i--) {
    if (s[i] == '1') q.push_front(i);
    if (q.size() > 0 and q.back() > i + k) q.pop_back();
    if (q.size() > 0) prev[i] = min(prev[i], q.front());
  }
  for (i = n; i > 0; i--) {
    dp[i - 1] = min(dp[i - 1], dp[i] + i);
    if (prev[i - 1] != INT_MAX) {
      dp[max(0ll, prev[i - 1] - k)] =
          min(dp[max(0ll, prev[i - 1] - k)], prev[i - 1] + 1 + dp[i]);
    }
  }
  cout << dp[0];
}
