#include <bits/stdc++.h>
using namespace std;
int minimum(char *Arr, int s, int m) {
  int countt = 0;
  int index = 0;
  int i;
  while (true) {
    for (i = m; i > 0; i--) {
      if (Arr[index + i] == '1') {
        countt++;
        index += i;
        break;
      }
      if (Arr[index + 1] == '0' && i == 1) return -1;
    }
    if (Arr[index + 1] == '\0') return countt;
  }
}
int main() {
  int s, m;
  cin >> s;
  char *Arr = (char *)malloc(s + 1);
  Arr[s] = '\0';
  cin >> m;
  cin >> Arr;
  cout << minimum(Arr, s, m);
  return 0;
}
