#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 5;
int main() {
  int n, d;
  string s;
  cin >> n >> d >> s;
  vector<int> jumps(n, INF);
  jumps[0] = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '0') continue;
    for (int j = max(0, i - d); j < i; j++) {
      if (s[j] == '1') {
        jumps[i] = min(jumps[i], 1 + jumps[j]);
      }
    }
  }
  if (jumps[n - 1] == INF) {
    jumps[n - 1] = -1;
  }
  cout << jumps[n - 1] << "\n";
  return 0;
}
