#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d, i, j, k;
  string s;
  cin >> n >> d;
  cin >> s;
  if (s[n - 1] != '1' || s[0] != '1') {
    cout << -1 << endl;
    return 0;
  }
  int step = 0;
  i = 0;
  while (i < n - 1) {
    if (i < n - d)
      k = i + d;
    else
      k = n - 1;
    while (s[k] != '1' && k - i > 0) {
      k--;
    }
    if (k - i <= 0) {
      cout << -1 << endl;
      return 0;
    }
    i = k;
    step++;
  }
  cout << step << endl;
  return 0;
}
