#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, d;
  cin >> n >> d;
  char arr[n];
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
  }
  int p = 0, ans = 0, a;
  while (p != n - 1) {
    for (int i = d; i > 0; --i) {
      a = p;
      if (arr[p + i] == '1') {
        p += i;
        ans++;
        break;
      }
    }
    if (a == p) {
      cout << -1 << endl;
      break;
    }
  }
  if (p == n - 1) {
    cout << ans << endl;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  for (int i = 0; i < t; ++i) {
    solve();
  }
}
