#include <bits/stdc++.h>
using namespace std;
const long long inf = 2e5 + 9, MX = 1e18 + 9;
long long n, k, tree[inf << 2], dp[inf];
string s;
vector<pair<long long, long long> > v[inf];
void build(long long node, long long l, long long r) {
  tree[node] = MX;
  if (l == r) return;
  build(node + node, l, (l + r) / 2);
  build(node + node + 1, (l + r) / 2 + 1, r);
}
void update(long long node, long long l, long long r, long long idx,
            long long val) {
  if (l == r) return void(tree[node] = val);
  if (idx <= (l + r) / 2)
    update(node + node, l, (l + r) / 2, idx, val);
  else
    update(node + node + 1, (l + r) / 2 + 1, r, idx, val);
  tree[node] = min(tree[node + node], tree[node + node + 1]);
}
long long query(long long node, long long l, long long r, long long x,
                long long y) {
  if (l > r || r < x || l > y) return MX;
  if (l >= x && r <= y) return tree[node];
  return min(query(node + node, l, (l + r) / 2, x, y),
             query(node + node + 1, (l + r) / 2 + 1, r, x, y));
}
int main() {
  cin >> n >> k >> s;
  for (long long i = 0; i < s.size(); i++)
    if (s[i] == '1')
      v[max(i - k, 0ll)].push_back(make_pair(min(i + k + 1, n), i + 1));
  build(1, 0, n);
  update(1, 0, n, n, 0);
  for (long long i = n - 1; i >= 0; i--) {
    dp[i] = dp[i + 1] + i + 1;
    for (auto o : v[i])
      dp[i] = min(dp[i], query(1, 0, n, i, o.first) + o.second);
    update(1, 0, n, i, dp[i]);
  }
  cout << dp[0] << endl;
}
