#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
inline void umax(long long &a, long long b) { a = max(a, b); }
inline void umin(long long &a, long long b) { a = min(a, b); }
inline pair<long long, long long> rv(pair<long long, long long> a) {
  return make_pair(a.second, a.first);
}
const long long N = 2e5 + 10;
const long long INF = 1e16 + 10;
const pair<long long, long long> NINF = make_pair(INF, INF);
const long double EPS = 1e-6;
const long long II = 1e9;
const long long MOD = 1e9 + 9;
long long dp[N];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, k;
  cin >> n >> k;
  string second;
  cin >> second;
  queue<pair<long long, long long> > buf;
  for (long long i = 0; i < (min(k, n)); i++)
    if (second[i] == '1') buf.push(make_pair(i + 1, i + k));
  for (long long i = 0; i < (n + 1); i++) dp[i] = INF;
  dp[0] = 1;
  for (long long i = 0; i < n; i++) {
    if (i + k < n && second[i + k] == '1')
      buf.push(make_pair(i + k + 1, i + k * 2));
    if (buf.size()) {
      auto beg = buf.front();
      long long pr = beg.second - k * 2 - 1;
      long long ll = (pr >= 0 ? dp[pr] : 0LL);
      umin(dp[i], ll + beg.first);
      if (beg.second == i) buf.pop();
    }
    if (i) umin(dp[i], dp[i - 1] + i + 1);
  }
  cout << dp[n - 1];
}
