#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d;
  string s;
  cin >> n;
  cin >> d;
  cin >> s;
  int m = 0, k = 0, p = 0, ok, t;
  int c = 0;
  while (c < n - 1) {
    c = min(p += d, n - 1);
    t = c;
    ok = 0;
    while (t > c - d && ok != 1)
      if (s[t] != '1')
        t--;
      else if (s[t] == '1') {
        k++;
        p = t;
        ok = 1;
        t--;
      }
    if (ok == 0) break;
  }
  if (ok != 0)
    cout << k;
  else
    cout << "-1";
  return 0;
}
