#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, d, x, c(0);
  cin >> n >> d;
  string arr;
  cin >> arr;
  x = 1;
  while (x < n) {
    long long i = d;
    long long flag = 0;
    while (i > 0) {
      if (x + i - 1 < n and arr[x + i - 1] == '1') {
        c++;
        x += i;
        flag = 1;
        break;
      }
      i--;
    }
    if (x == n) break;
    if (flag == 0) return cout << -1, 0;
  }
  if (x == n) return cout << c, 0;
  return cout << -1, 0;
  return 0;
}
