#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 7;
int n, d, ans;
char str[maxn];
int main() {
  scanf("%d%d", &n, &d);
  scanf("%s", str);
  int now = 0;
  while (now < n) {
    bool flag = false;
    for (int i = now + d; i > now; i--) {
      if (i >= n - 1) {
        now = n, ans++, flag = true;
        break;
      }
      if (str[i] == '1') {
        now = i, ans++, flag = true;
        break;
      }
    }
    if (!flag) return 0 * printf("-1\n");
  }
  printf("%d\n", ans);
  return 0;
}
