#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 7, INF = 1e15;
long long lst[N], dp[N];
void solve() {
  long long n, d;
  cin >> n >> d;
  string s;
  cin >> s;
  queue<long long> lef;
  for (long long i = 0; i < (long long)n; ++i)
    if (s[i] == '1') lef.push(i);
  for (long long i = 0; i < (long long)n; ++i) {
    lst[i] = (lef.empty() || i + d < lef.front() ? -1 : lef.front());
    if (!lef.empty() && i - lef.front() == d) lef.pop();
  }
  for (long long i = 0; i < (long long)n; ++i) dp[i] = INF;
  for (long long i = n - 1; i >= 0; --i) {
    dp[i] = min(dp[i], dp[i + 1] + i + 1);
    if (lst[i] != -1)
      dp[max(0ll, lst[i] - d)] =
          min(dp[max(0ll, lst[i] - d)], dp[i + 1] + lst[i] + 1);
  }
  cout << dp[0];
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
