#include <bits/stdc++.h>
using namespace std;
int n, d, a[105], b[105], ans = 0, s = 1, l, r;
char c;
int main() {
  scanf("%d%d", &n, &d);
  for (int i = 1; i <= n; i++) {
    scanf(" %c", &c);
    a[i] = (c == '1'), b[i] = a[i] + b[i - 1];
  }
  b[n + 1] = b[n];
  while (s < n) {
    int l = s + 1, r = min(s + d, n + 1), p = min(s + d, n + 1);
    if (b[r] == b[s]) break;
    while (l + 1 < r) {
      int m = (l + r) / 2;
      if (b[m] < b[p])
        l = m + 1;
      else
        r = m;
    }
    s = (a[r] ? r : l), ans++;
  }
  printf("%d", (s == n ? ans : -1));
}
