#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MAXN = 2e5 + 50;
const long long LINF = 0x3f3f3f3f3f3f3f3f;
const long long MOD = 1e9 + 7;
const double EPS = 1e-6;
const double Pi = acos(-1);
void test() { cerr << "\n"; }
template <typename T, typename... Args>
void test(T x, Args... args) {
  cerr << x << " ";
  test(args...);
}
long long qpow(long long a, long long b) {
  return b ? ((b & 1) ? a * qpow(a * a % MOD, b >> 1) % MOD
                      : qpow(a * a % MOD, b >> 1)) %
                 MOD
           : 1;
}
long long qpow(long long a, long long b, long long c) {
  return b ? ((b & 1) ? a * qpow(a * a % c, b >> 1) % c
                      : qpow(a * a % c, b >> 1)) %
                 c
           : 1;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int sign(double x) { return x < -EPS ? -1 : x > EPS; }
int dbcmp(double l, double r) { return sign(l - r); }
long long dp[MAXN];
char str[MAXN];
long long sv, fw[MAXN];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  scanf("%s", str + 1);
  memset(dp, 0x3f, sizeof(dp));
  dp[n + 1] = 0;
  multiset<long long> ms, vl;
  ms.insert(0);
  for (int i = n; i > 0; i--) {
    dp[i] = dp[i + 1] + i;
    if (i + k + 2 <= n + 1) ms.erase(ms.find(dp[i + k + 2]));
    if (fw[i] != 0) vl.erase(vl.find(fw[i]));
    if (!vl.empty()) dp[i] = min(dp[i], *vl.begin());
    if (str[i] == '1') {
      long long now = (ms.empty() ? 0 : *ms.begin()) + i;
      vl.insert(now);
      dp[i] = min(dp[i], now);
      if (i - k - 1 > 0) fw[i - k - 1] = now;
    }
    ms.insert(dp[i]);
  }
  printf("%lld", dp[1]);
}
