#include <bits/stdc++.h>
using namespace std;
long long int n, d, mx, ans;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> d;
  string s;
  cin >> s;
  if (n == 2) {
    cout << 1 << endl;
  } else {
    long long int i = 0, ans = 0;
    bool pass = true;
    while (i <= n - 1) {
      mx = 0;
      for (long long int j = 1; j <= d; j++) {
        if (i + j < n && s[i + j] == '1') {
          mx = max(mx, i + j);
        }
      }
      if (mx == 0) {
        pass = false;
        break;
      } else {
        ans++;
        i = mx;
        if (i == n - 1) {
          break;
        }
      }
    }
    if (pass) {
      cout << ans << endl;
    } else {
      cout << -1 << endl;
    }
  }
  return 0;
}
