#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d, i, j, tot = 0;
  string s;
  bool ok = true;
  cin >> n >> d >> s;
  for (i = 0; i < s.size(); i++) {
    int top = min(i + d, n - 1);
    if (i == n - 1) break;
    for (j = top; j >= i; j--) {
      if (j == i) {
        ok = false;
        break;
      }
      if (s[j] == '1') {
        tot++;
        i = j - 1;
        break;
      }
    }
    if (!ok) {
      tot = -1;
      break;
    }
  }
  cout << tot << endl;
}
