#include <bits/stdc++.h>
std::mt19937 rng(
    int(std::chrono::steady_clock::now().time_since_epoch().count()));
class Solution {
 private:
  int N;
  int K;
  std::string S;
  std::vector<int> cost;
  std::vector<int> jump;
  std::vector<long long int> dp;
  void build() {
    cost.resize(N);
    jump = std::vector<int>(N, INT_MAX);
    for (int i = 0, j = 0; i < N; i += 1) {
      if (S[i] == '0') {
        continue;
      }
      while (j < N and j <= i + K) {
        if (abs(j - i) <= K) {
          jump[j] = i - K - 1;
          cost[j] = i + 1;
        }
        j += 1;
      }
    }
    dp = std::vector<long long int>(N, -1);
  }
  long long int solve(const int& i) {
    if (i < 0) {
      return 0LL;
    }
    if (dp[i] != -1) {
      return dp[i];
    }
    long long int ans = solve(i - 1) + i + 1;
    if (jump[i] != INT_MAX) {
      ans = std::min(ans, solve(jump[i]) + cost[i]);
    }
    dp[i] = ans;
    return dp[i];
  }

 public:
  Solution() {
    std::ios_base::sync_with_stdio(0);
    std::cin.tie(0);
    std::cout.tie(0);
  }
  void main() {
    std::cin >> N >> K;
    std::cin >> S;
    build();
    std::cout << solve(N - 1) << std::endl;
  }
};
int main() {
  Solution().main();
  return 0;
}
