#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, d;
  cin >> n >> d;
  string s;
  cin >> s;
  vector<int> a(n, (int)1e9);
  a[0] = 0;
  for (int i = 1; i < n; i++) {
    if (s[i] == '0') continue;
    for (int j = max(0, i - d); j < i; j++) {
      a[i] = min({a[i], a[j] + 1});
    }
  }
  if (a[n - 1] > 200) {
    cout << "-1";
  } else
    cout << a[n - 1];
}
