#include <bits/stdc++.h>
using namespace std;
const long double PI = 4 * atan(1);
void solve() {
  int n, d;
  cin >> n >> d;
  string s;
  cin >> s;
  int jumps = 0, curr = 0;
  while (curr != n - 1) {
    bool flag = true;
    for (int i = min(d, n - curr); i > 0; i--) {
      if (s[curr + i] == '1') {
        flag = false;
        curr += i;
        jumps++;
        break;
      }
    }
    if (flag) {
      cout << -1 << endl;
      return;
    }
  }
  cout << jumps << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(0);
  solve();
  return 0;
}
