#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e12;
const long long N = 2e5 + 5;
long long a[N];
long long tree[N << 2];
long long combine(long long x, long long y) { return min(x, y); }
void build(long long l, long long r, long long node) {
  if (l == r) {
    tree[node] = inf;
    return;
  }
  long long mid = l + r >> 1, lc = node + node, rc = 1 + lc;
  build(l, mid, lc);
  build(mid + 1, r, rc);
  tree[node] = combine(tree[lc], tree[rc]);
}
long long query(long long l, long long r, long long ql, long long qr,
                long long node) {
  if (qr < l || r < ql) return inf;
  if (ql <= l and r <= qr) {
    return tree[node];
  }
  long long mid = l + r >> 1, lc = node + node, rc = 1 + lc;
  return combine(query(l, mid, ql, qr, lc), query(mid + 1, r, ql, qr, rc));
}
void update(long long l, long long r, long long pos, long long val,
            long long node) {
  if (pos < l || r < pos) return;
  if (l == r and l == pos) {
    tree[node] = val;
    return;
  }
  long long mid = l + r >> 1, lc = node + node, rc = 1 + lc;
  update(l, mid, pos, val, lc);
  update(mid + 1, r, pos, val, rc);
  tree[node] = combine(tree[lc], tree[rc]);
}
const long long maxn = 2e5 + 3;
char s[maxn];
long long n, k;
long long q(long long l, long long r) {
  if (l == 0) return 0;
  if (l > r) return inf;
  return query(1, n, l, r, 1);
}
void solve() {
  cin >> n >> k;
  cin >> (s + 1);
  vector<array<long long, 3>> v;
  v.reserve(n);
  for (long long i = 1; i <= n; ++i) {
    v.push_back({i, i, i});
    if (s[i] == '1') {
      long long l = max(1LL, i - k);
      long long r = min(n, i + k);
      v.push_back({r, l, i});
    }
  }
  sort(v.begin(), v.end());
  ;
  build(1, n, 1);
  for (long long i = 1; i <= n; ++i) {
    long long x = query(1, n, i, i, 1);
  }
  long long ans;
  for (long long i = 0; i < v.size();) {
    long long r = v[i][0];
    long long minCur = inf;
    while (i < v.size() && v[i][0] == r) {
      long long l = v[i][1];
      long long x = q(l - 1, r - 1);
      long long a = l - 1, b = r - 1;
      ;
      minCur = min(minCur, q(l - 1, r - 1) + v[i][2]);
      ++i;
    };
    update(1, n, r, minCur, 1);
    ans = minCur;
  }
  cout << ans << '\n';
  for (long long i = 1; i <= n; ++i) {
    long long x = query(1, n, i, i, 1);
    ;
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  for (long long i = 1; i <= t; ++i) {
    solve();
  }
  return 0;
}
