#include <bits/stdc++.h>
using namespace std;
void solve(string s, int n, int step) {
  vector<int> res(n, INT_MAX);
  res[0] = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] != '1') continue;
    if (res[i] == INT_MAX) {
      cout << "-1";
      return;
    }
    for (int j = 1; j <= step; j++)
      if ((i + j) < n) res[i + j] = min(res[i + j], res[i] + 1);
  }
  cout << (res[n - 1] != INT_MAX ? res[n - 1] : -1);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, step;
  cin >> n >> step;
  string s;
  cin >> s;
  solve(s, n, step);
  return 0;
}
