#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d;
  vector<int> tab;
  cin >> n >> d;
  int akt = 0;
  int pop = 1;
  for (int i = 1; i < n + 1; i++) {
    char temp;
    cin >> temp;
    if (temp == '1') {
      tab.push_back(i);
      pop = tab[tab.size() - 1];
    }
  }
  int cnt = 1;
  pop = 1;
  for (int i = 0; i < tab.size(); i++) {
    if (tab[i] > pop + d) {
      if (tab[i] - tab[i - 1] <= d) {
        cnt++;
        pop = tab[i - 1];
      } else {
        cout << "-1" << endl;
        return 0;
      }
    }
  }
  cout << cnt << endl;
}
