#include <bits/stdc++.h>
int main() {
  int n, k;
  std::cin >> n >> k;
  std::cin.get();
  std::string s;
  std::getline(std::cin, s);
  std::vector<long long> m(n, std::numeric_limits<long long>::max());
  int i, j;
  std::queue<int> router_idxs;
  std::vector<int> leftmost(n, -1);
  for (i = 0; i < n; ++i) {
    if (s[i] == '1') {
      router_idxs.push(i);
    }
  }
  for (i = 0; i < n; ++i) {
    while (router_idxs.size() > 0 && i > router_idxs.front() + k) {
      router_idxs.pop();
    }
    if (router_idxs.size() > 0 && i >= router_idxs.front() - k &&
        i <= router_idxs.front() + k) {
      leftmost[i] = router_idxs.front();
    }
  }
  int router_idx;
  m[0] = 1;
  for (i = 1; i < n; ++i) {
    m[i] = m[i - 1] + i + 1;
    if (leftmost[i] > -1) {
      router_idx = leftmost[i];
      long long router_cost;
      if (router_idx - k - 1 >= 0) {
        router_cost = m[router_idx - k - 1] + router_idx + 1;
      } else {
        router_cost = router_idx + 1;
      }
      m[i] = std::min(m[i], router_cost);
    }
  }
  std::cout << m[n - 1] << std::endl;
  return 0;
}
