#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
ostream& operator<<(ostream& o, pair<A, B> a) {
  return o << a.first << ' ' << a.second;
}
template <typename A, typename B>
istream& operator>>(istream& o, pair<A, B>& a) {
  return o >> a.first >> a.second;
}
const int mod = 998244353, abc = 864197532, N = 200005, K = 111;
struct Seg {
  int l, r, m;
  long long int mn;
  Seg* ch[2];
  Seg(int _l, int _r) : l(_l), r(_r), m(l + r >> 1), mn(1ll << 60) {
    if (r - l > 1) {
      ch[0] = new Seg(l, m);
      ch[1] = new Seg(m, r);
    }
  }
  void pull() { mn = min(ch[0]->mn, ch[1]->mn); }
  void set(int p, long long int v) {
    if (r - l == 1)
      mn = v;
    else
      ch[p >= m]->set(p, v), pull();
  }
  long long int query(int a, int b) {
    if (a <= l && r <= b) return mn;
    long long int ans = 1ll << 60;
    if (a < m) ans = min(ans, ch[0]->query(a, b));
    if (m < b) ans = min(ans, ch[1]->query(a, b));
    return ans;
  }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  string s;
  cin >> n >> k >> s;
  s = "$" + s;
  vector<long long int> dp(n + 1, 1ll << 60);
  dp[0] = 0;
  vector<pair<int, int> > range[n + 1];
  for (int i = 1; i <= n; ++i)
    if (s[i] == '1') {
      int l = max(1, i - k) - 1, r = min(i + k, n);
      range[r].emplace_back(l, i);
    }
  Seg root(0, n + 1);
  root.set(0, 0);
  for (int i = 1; i <= n; ++i) {
    dp[i] = dp[i - 1] + i;
    for (pair<int, int> a : range[i]) {
      dp[i] = min(dp[i], a.second + root.query(a.first, i));
    }
    root.set(i, dp[i]);
  }
  cout << dp[n] << endl;
}
