#include <bits/stdc++.h>
using namespace std;
char a[200];
int main() {
  int n, d, pos = 0, cnt = 0;
  cin >> n >> d;
  for (int i = 0; i < n; ++i) cin >> a[i];
  while (pos != n - 1) {
    int go;
    for (int i = d; i >= 0; --i) {
      if (pos + i < n && a[pos + i] - 48) {
        go = i;
        break;
      }
    }
    if (!go) {
      cout << "-1\n";
      return 0;
    }
    pos += go;
    ++cnt;
  }
  cout << cnt << '\n';
}
