#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d, ans = 0;
  cin >> n >> d;
  char arr[n];
  scanf("%s", arr);
  if (arr[0] == '0' || arr[n - 1] == '0') {
    cout << -1;
    exit(0);
  }
  int pnt = 0;
  while (pnt + d < n) {
    int check = 0;
    for (int i = pnt + d; i != pnt; i--) {
      if (arr[i] == '1') {
        pnt = i;
        ans++;
        check = check + 1;
        break;
        break;
      }
    }
    if (check == 0) {
      cout << -1;
      exit(0);
    }
  }
  if (pnt < n - 1) ans++;
  cout << ans;
}
