#include <bits/stdc++.h>
using namespace std;
long long int n, k, ans = 0, dp[200003], l1[200002];
string s;
set<long long int> S;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> k >> s;
  dp[n] = 0;
  int r = n - 1;
  long long int cur = -1e9;
  for (int i = 0; i < n; ++i) {
    l1[i] = -1e9;
    dp[i] = 1e18;
  }
  long long int last;
  for (int i = 0; i <= k && r - i >= 0; ++i) {
    if (s[r - i] == '1') l1[r] = r - i;
    last = r - i;
  }
  last--;
  for (int i = n - 2; i >= 0; i--, last--) {
    l1[i] = l1[i + 1];
    if (last >= 0 && s[last] == '1') l1[i] = last;
  }
  for (int i = n - 1, j; i >= 0; i--) {
    dp[i] = min(dp[i], dp[i + 1] + i + 1);
    if (l1[i] + k >= i) {
      j = max(0LL, l1[i] - k);
      dp[j] = min(dp[j], dp[i + 1] + l1[i] + 1);
    }
  }
  cout << dp[0] << '\n';
  return 0;
}
