#include <bits/stdc++.h>
int count_jumps(std::string map, int d) {
  std::vector<int> jumps(map.length(), -1);
  jumps[map.length() - 1] = 0;
  std::cerr << jumps[0] << std::endl;
  for (int i = map.length() - 2; i > -1; --i) {
    if (map[i] == '0') {
      continue;
    }
    int min_to_finish = 1000;
    bool updated = false;
    for (int j = d; j > 0; --j) {
      if (i + j >= map.length() || map[i + j] == '0') {
        continue;
      }
      if (jumps[i + j] != -1 && jumps[i + j] < min_to_finish) {
        std::cerr << i << " " << j << std::endl;
        min_to_finish = jumps[i + j];
        updated = true;
      }
    }
    if (updated) {
      jumps[i] = min_to_finish + 1;
    }
    std::cerr << "Can reach " << i << " in " << jumps[i] << " jumps."
              << std::endl;
  }
  return jumps[0];
}
int main(void) {
  int n, d;
  std::cin >> n >> d;
  std::string s;
  std::cin >> s;
  int total_jumps = count_jumps(s, d);
  std::cout << total_jumps << std::endl;
}
