#include <bits/stdc++.h>
using namespace std;
void c_p_c() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int32_t main() {
  c_p_c();
  long long int n, d;
  cin >> n >> d;
  char a[n];
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<long long int> dp(n + 1, 1000000);
  dp[0] = 0;
  for (long long int i = 1; i < n; i++) {
    if (a[i] == '1') {
      for (long long int j = i - 1; j >= 0 and j >= i - d; j--) {
        dp[i] = min(dp[i], dp[j] + 1);
      }
    }
  }
  long long int ans = dp[n - 1];
  if (dp[n - 1] == 1000000) {
    ans = -1;
  }
  cout << ans << '\n';
  return 0;
}
