#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  string s;
  int sum = 0;
  cin >> n >> m >> s;
  for (int i = 0; i < n; i++) {
    int flag = 0;
    for (int j = i + m; j > i; j--) {
      if (s[j] == '1') {
        sum++;
        i = j;
        flag = 1;
        i--;
        break;
      }
      if (s[j] == '0' && j == i + 1) {
        cout << -1;
        return 0;
      }
    }
  }
  cout << sum;
}
