#include <bits/stdc++.h>
using namespace std;
int n, d;
char s[103];
bool key1;
bool key2;
int cnt;
int main() {
  scanf("%d %d\n", &n, &d);
  for (int i = 0; i < n; i++) {
    scanf("%c", &s[i]);
  }
  int j;
  for (int i = 0; i < n;) {
    j = i + d;
    for (; j > i; j--) {
      if (s[j] == '1') {
        key1 = 1;
        key2 = 1;
        break;
      } else
        key1 = 0;
    }
    if (key2) {
      i = j;
      key2 = 0;
      cnt++;
    }
    if (i == n - 1) break;
    if (key1 == 0) break;
  }
  if (key1)
    printf("%d\n", cnt);
  else
    printf("-1\n");
  return 0;
}
