#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, d;
  cin >> n >> d;
  string str;
  cin >> str;
  int jumps = 0;
  for (int i = 0; i < n - 1; ++i) {
    bool found = false;
    for (int j = min(i + d, n - 1); j > i; --j) {
      if (str[j] == '1') {
        ++jumps;
        i = j - 1;
        found = true;
        break;
      }
    }
    if (!found) {
      jumps = -1;
      break;
    }
  }
  cout << jumps;
  return 0;
}
