#include <bits/stdc++.h>
using namespace std;
string s;
int now, len, d, ans;
int main() {
  cin >> len >> d >> s;
  len--;
  if (s[0] == '0' || s[len] == '0') printf("-1\n");
  while (now != len) {
    bool flag = 0;
    for (register int i = now + d; i >= now + 1; i--)
      if (s[i] == '1') {
        now = i, flag = 1;
        break;
      }
    if (flag == 0) {
      printf("-1\n");
      return 0;
    } else
      ans++;
  }
  printf("%d\n", ans);
  return 0;
}
