#include <bits/stdc++.h>
using namespace std;
int a[200000], b[200000];
vector<int> v;
int main() {
  int n, m;
  cin >> n >> m;
  string s;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '1') v.push_back(i);
  }
  for (int i = 1; i < v.size(); i++) {
    if (v[i] - v[i - 1] > m) {
      cout << -1;
      return 0;
    }
  }
  int ans = 0;
  for (int i = 0; i < v.size(); i++) {
    int x = -1;
    for (int j = 1; j < v.size(); j++) {
      if (v[j] - v[i] > m) {
        x = j - 1;
        break;
      }
    }
    ans++;
    if (x == -1 || x == n) {
      cout << ans;
      return 0;
    }
    i = x - 1;
  }
  return 0;
}
