#include <bits/stdc++.h>
using namespace std;
const int maxn = 2 * 1e5 + 5;
long long dp[2 * maxn];
int ans[maxn];
int main() {
  int n, k;
  cin >> n >> k;
  char s[maxn];
  scanf("%s", s + 1);
  memset(dp, 0, sizeof dp);
  ans[n + 1] = 0x3f3f3f3f;
  for (int i = n; i >= 1; i--) {
    ans[i] = s[i] == '1' ? i : ans[i + 1];
  }
  for (int i = 1; i <= n; i++) {
    dp[i] = dp[i - 1] + i;
    int l = ans[max(1, i - k)];
    if (l <= i + k) {
      dp[i] = min(dp[i], dp[max(1, l - k) - 1] + l);
    }
  }
  cout << dp[n];
  return 0;
}
