#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9;
const long long inf64 = 1e18;
const long long MOD = inf + 7;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  long long dp[n + 1][2];
  for (long long i = 0; i < n + 1; i++) dp[i][0] = dp[i][1] = inf64;
  dp[0][0] = 0;
  dp[0][1] = inf64;
  multiset<long long> mt, mt1;
  mt1.insert(dp[0][0]);
  mt.insert(dp[0][1]);
  for (long long i = 1; i <= n; i++) {
    dp[i][0] = min(dp[i - 1][0], dp[i - 1][1]) + i;
    dp[i][0] = min(dp[i][0], *mt.begin());
    long long prev = max(0LL, i - k - 1);
    if (s[i - 1] == '1') {
      dp[i][1] = *mt1.begin() + i;
    }
    mt.insert(dp[i][1]);
    mt1.insert(dp[i][0]);
    if (i >= k) {
      mt.erase(mt.find(dp[i - k][1]));
    }
    if (i >= k + 1) {
      mt1.erase(mt1.find(dp[i - k - 1][0]));
    }
  }
  cout << min(dp[n][0], dp[n][1]) << "\n";
}
