#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d;
  cin >> n >> d;
  string s;
  cin >> s;
  int jumps = 0;
  pair<int, int> interval = {0, d};
  while (true) {
    bool found = false;
    for (int i = interval.second; i >= interval.first && !found; i--) {
      if (s[i] == '1' && i != interval.first) {
        found = true;
        interval.first = i;
        interval.second = interval.first + d;
        jumps++;
      }
      if (interval.first >= n - 1) {
        cout << jumps;
        return 0;
      } else if (interval.second >= n) {
        cout << jumps + 1;
        return 0;
      } else if (i == interval.first && !found) {
        cout << -1;
        return 0;
      }
    }
  }
}
