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