#include <bits/stdc++.h>
using namespace std;
int main() {
  int xx = 1, j, i = 0, n, d, k = 0, x, y;
  cin >> n >> d;
  string s;
  cin >> s;
  y = s.length() - 1;
  while (i != y) {
    xx = 1;
    j = d;
    while (i + j != i) {
      if (s[i + j] == '1') {
        k++;
        i = i + j;
        xx = 0;
        break;
      } else
        j = j - 1;
    }
    if (xx == 1) {
      cout << "-1";
      return 0;
    }
  }
  cout << k;
}
