#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma comment(linker, "/stack:200000000")
using namespace std;
long long spf[301];
long long fac[301];
void sieve() {
  spf[1] = 1;
  for (long long i = 2; i < 301; i++) spf[i] = i;
  for (long long i = 4; i < 301; i += 2) spf[i] = 2;
  for (long long i = 3; i * i < 301; i++) {
    if (spf[i] == i) {
      for (long long j = i * i; j < 301; j += i)
        if (spf[j] == j) spf[j] = i;
    }
  }
}
map<long long, long long> getfactor(long long a) {
  map<long long, long long> m;
  while (a > 1) {
    m[spf[a]]++;
    a /= spf[a];
  }
  return m;
}
long long power(long long x, long long y, long long p) {
  long long res = 1;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x);
    y = y >> 1;
    x = (x * x);
  }
  return res;
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long inverse(long long a, long long p) { return power(a, p - 2, p); }
long long ncr(long long n, long long r, long long p) {
  if (r > n) return 0;
  if (r == 0) return 1;
  return (fac[n] * inverse(fac[r], p) % p * inverse(fac[n - r], p) % p) % p;
}
long long seg[4000009], lazy[4000009];
void push(long long v) {
  seg[v * 2] = min(lazy[v], seg[v * 2]);
  seg[v * 2 + 1] = min(lazy[v], seg[v * 2 + 1]);
  lazy[v * 2] = min(lazy[v], lazy[v * 2]);
  lazy[v * 2 + 1] = min(lazy[v], lazy[v * 2 + 1]);
  lazy[v] = 1e18;
}
void updateseg(long long v, long long l, long long r, long long posl,
               long long posr, long long val) {
  if (l >= posl && r <= posr) {
    seg[v] = min(val, seg[v]);
    lazy[v] = min(val, lazy[v]);
    return;
  } else if (l > posr || r < posl)
    return;
  push(v);
  long long mid = (l + r) / 2;
  updateseg(v * 2, l, mid, posl, posr, val);
  updateseg(v * 2 + 1, mid + 1, r, posl, posr, val);
  seg[v] = min(seg[v * 2], seg[v * 2 + 1]);
}
long long query(long long v, long long l, long long r, long long posl,
                long long posr) {
  if (l >= posl && r <= posr)
    return seg[v];
  else if (l > posr || r < posl)
    return 1e18;
  push(v);
  long long mid = (l + r) / 2;
  return min(query(v * 2, l, mid, posl, posr),
             query(v * 2 + 1, mid + 1, r, posl, posr));
}
void solve() {
  for (long long i = 0; i <= 2000000; i++) {
    seg[i] = 1e18;
    lazy[i] = 1e18;
  }
  long long n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  long long m = 2 * n;
  for (long long i = 1; i <= n; i++) {
    if (i == 1)
      updateseg(1, 1, m, i, i, i);
    else
      updateseg(1, 1, m, i, i, query(1, 1, m, i - 1, i - 1) + i);
    if (i <= k + 1 && s[i - 1] == '1')
      updateseg(1, 1, m, i, i + k, i);
    else if (s[i - 1] == '1') {
      long long gg = query(1, 1, m, i - k - 1, i);
      updateseg(1, 1, m, i, i + k, gg + i);
    }
  }
  cout << query(1, 1, m, n, n) << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long test = 1;
  while (test--) {
    solve();
  }
}
