#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, tmp = 0;
  string s;
  cin >> a >> b;
  cin >> s;
  int now = 0, y = 0;
  while (now < a - 1 && y <= a) {
    if (s[now] == '1') {
      now += b;
      y++;
    } else {
      now--;
    }
  }
  if (y >= a)
    cout << "-1";
  else
    cout << y;
}
