#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  vector<int> v;
  int n, d, p = 0, cnt = 0, mx = -1;
  cin >> n >> d >> s;
  for (int i = 0; i < n; i++)
    if (s[i] == '1') v.push_back(i);
  for (int i = 1; i < v.size(); i++) {
    if (v[i] - v[i - 1] > mx) mx = v[i] - v[i - 1];
  }
  if (mx > d) {
    cout << -1;
    return 0;
  }
  while (p < n - 1) {
    p += d;
    while (s[p] == '0') p--;
    cnt++;
  }
  cout << cnt;
  return 0;
}
