#include <bits/stdc++.h>
using namespace std;
const long long MX = 2e5 + 5;
long long n, k, dp[MX];
string s;
vector<long long> v;
long long solve(long long ind) {
  if (ind < 0) return 0;
  if (dp[ind] != -1) return dp[ind];
  long long ans = solve(ind - 1) + ind + 1;
  long long last_ind = lower_bound(v.begin(), v.end(), ind - k) - v.begin();
  if (v.size() && last_ind < v.size() && -ind + v[last_ind] <= k)
    ans = min(ans, solve(v[last_ind] - k - 1) + v[last_ind] + 1);
  return dp[ind] = ans;
}
int32_t main() {
  cin >> n >> k >> s;
  for (long long i = 0; i < n; i++)
    if (s[i] - '0') v.push_back(i);
  memset(dp, -1, sizeof dp);
  return cout << solve(n - 1) << endl, 0;
}
