#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, d, np = 0, ans = 0;
  cin >> n >> d;
  string s;
  cin >> s;
  for (int i = 0; i < n;) {
    int k = -1;
    for (int j = ((i + d) < n ? i + d : n - 1); j > i; j--)
      if (s[j] == '1') {
        k = j;
        break;
      }
    if (k == n - 1) {
      ans++;
      break;
    }
    if (k == -1) {
      np = 1;
      break;
    }
    i = k;
    ans++;
  }
  if (!np)
    cout << ans;
  else
    cout << "-1";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
