#include <bits/stdc++.h>
#pragma GCC optimize("Ofast, unroll-loops", "omit-frame-pointer", "inline")
#pragma GCC option("arch=native", "tune=native", "no-zero-upper")
#pragma GCC target( \
    "sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native,avx2")
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int getrnd(int l, int r) { return uniform_int_distribution<int>(l, r)(rng); }
template <typename T1, typename T2>
bool relax(T1& a, const T2& b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T1, typename T2>
bool strain(T1& a, const T2& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
const ll INF = 1e18;
const int N = 2e5 + 3;
ll tree[4 * N];
void update(int v, int tl, int tr, int pos, ll x) {
  if (tl == tr)
    tree[v] = x;
  else {
    int tm = (tl + tr) / 2;
    if (pos <= tm)
      update(2 * v, tl, tm, pos, x);
    else
      update(2 * v + 1, tm + 1, tr, pos, x);
    tree[v] = min(tree[2 * v], tree[2 * v + 1]);
  }
}
ll get(int v, int tl, int tr, int l, int r) {
  if (l > r) return INF;
  if (tl == l && tr == r)
    return tree[v];
  else {
    int tm = (tl + tr) / 2;
    return min(get(2 * v, tl, tm, l, min(r, tm)),
               get(2 * v + 1, tm + 1, tr, max(tm + 1, l), r));
  }
}
void solve() {
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  vector<vector<pair<int, int>>> lines(n);
  for (int i = 0; i < n; ++i) {
    if (s[i] == '1')
      lines[min(n - 1, i + k)].emplace_back(max(0, i - k), i + 1);
  }
  vector<ll> dp(n + 1);
  for (int i = 1; i <= n; ++i) {
    dp[i] = dp[i - 1] + i;
    for (auto p : lines[i - 1]) {
      int line = p.first, cost = p.second;
      relax(dp[i], get(1, 0, n - 1, line, i - 1) + cost);
    }
    update(1, 0, n - 1, i, dp[i]);
  }
  cout << dp[n] << '\n';
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(nullptr);
  cout.tie(nullptr);
  srand(time(0));
  int t = 1;
  while (t--) solve();
  return 0;
}
