#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d;
  cin >> n >> d;
  string s;
  cin >> s;
  int count = 0;
  for (int i = 1; i < n; i++) {
    string s2(s.begin() + i, s.begin() + min(d, n - i) + i);
    int ans = -1;
    for (int j = 0; j < s2.length(); j++) {
      if (s2[j] == '1') {
        ans = j;
      }
    }
    if (ans == -1) {
      cout << "-1";
      return 0;
    }
    i += ans;
    count++;
  }
  cout << count;
}
