#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, d;
  cin >> n >> d;
  vector<long long> lily;
  string s;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '1') lily.push_back(i);
  }
  int pos = 0;
  int c = 0;
  while (pos != n - 1) {
    c++;
    int flag = 0;
    for (int i = pos + d; i > pos; i--) {
      auto it = find(lily.begin(), lily.end(), i);
      if (it != lily.end()) {
        pos = i;
        flag = 1;
        break;
      }
    }
    if (!flag) {
      cout << "-1" << endl;
      break;
    }
  }
  if (pos == n - 1) cout << c << endl;
  return 0;
}
