#include <bits/stdc++.h>
using namespace std;
const int N = 400004;
const int p = 998244353;
int n, K;
char s[N];
long long f[N];
int h[N], t, w;
void read(int &x) {
  char ch = getchar();
  x = 0;
  for (; ch < '0' || ch > '9'; ch = getchar())
    ;
  for (; ch >= '0' && ch <= '9'; ch = getchar())
    x = (x << 3) + (x << 1) + ch - '0';
}
int main() {
  read(n);
  read(K);
  scanf("%s", s + 1);
  memset(f, 0x3f, sizeof f);
  f[0] = 0;
  h[t = w = 1] = 0;
  long long ans = 1e18;
  for (int i = (1); i <= (n + K); i++) {
    f[i] = min(f[i], f[i - 1] + i);
    if (i <= K || s[i - K] != '1')
      233;
    else {
      while (w - t >= 0 && h[t] <= i - 2 * K - 2) t++;
      if (w - t >= 0) f[i] = min(f[i], f[h[t]] + i - K);
    }
    h[++w] = i;
    while (w > t && f[h[w]] <= f[h[w - 1]]) h[w - 1] = h[w], w--;
    if (i >= n) ans = min(ans, f[i]);
  }
  cout << ans << endl;
  return 0;
}
