#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d;
  int b = 1;
  int cnt = 0;
  cin >> n >> d;
  char *mas = new char[n];
  for (int i = 0; i < n; i++) cin >> mas[i];
  for (int i = 0; i < n - 1 && b;) {
    for (int j = d; j >= 0; j--) {
      if (j == 0) {
        b = 0;
        break;
      }
      if (i + j >= n) continue;
      if (mas[i + j] == '1') {
        i += j;
        cnt++;
        break;
      }
    }
  }
  if (!b) cnt = -1;
  cout << cnt;
}
