#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int maxn = 2e5 + 100;
int n, m, k, t;
char s[maxn];
long long a[maxn], dp[maxn];
int main() {
  scanf("%d%d%s", &n, &k, s + 1);
  a[n + 1] = mod;
  for (int i = n; i >= 1; i--) {
    if (s[i] == '1')
      a[i] = i;
    else
      a[i] = a[i + 1];
  }
  for (int i = 1; i <= n; i++) {
    dp[i] = dp[i - 1] + i;
    long long q = a[max(1, i - k)];
    if (q <= i + k) dp[i] = min(dp[i], dp[max(1ll, q - k) - 1] + q);
  }
  printf("%lld\n", dp[n]);
}
