#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, flag, ans = 0;
  cin >> n >> k;
  char a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long i = 0;
  while (i < n) {
    if (i >= (n - 1 - k)) {
      flag = 1;
      goto a;
    }
    for (long long j = k + i; j > i; j--) {
      if (a[j] == '1') {
        i = j;
        ans++;
        break;
      }
      if (j == i + 1 && a[j] == '0') {
        flag = 0;
        goto a;
      }
    }
  }
a:
  if (flag == 0) {
    cout << "-1" << endl;
  } else {
    cout << ans + 1 << endl;
  }
  return 0;
}
