#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int n, d;
  cin >> n >> d;
  vector<int> vec;
  for (int i = 0; i < n; i++) {
    char ch;
    cin >> ch;
    if (ch == '1') vec.push_back(i + 1);
  }
  int k = 1;
  bool fl = false;
  int cnt = 0;
  while (k != n) {
    int ind = lower_bound(vec.begin(), vec.end(), (k + d)) - vec.begin();
    if (vec[ind] != (k + d)) {
      ind--;
    }
    if (vec[ind] == k) {
      fl = true;
      break;
    }
    cnt++;
    k = vec[ind];
  }
  if (fl)
    cout << -1;
  else
    cout << cnt;
  return 0;
}
