#include <bits/stdc++.h>
using namespace std;
int n, d, a;
bool b = true;
string s;
int main() {
  cin >> n >> d;
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    s += c;
  }
  for (int i = 0; i + d < n - 1; i++) {
    bool be = false;
    for (int j = i + d; j > i; j--)
      if (s[j] == '1') {
        be = true;
        i = j - 1;
        break;
      }
    if (!be) {
      b = false;
      break;
    }
    a++;
  }
  if (b)
    cout << a + 1 << endl;
  else
    cout << -1 << endl;
  return 0;
}
