#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, d;
  cin >> n >> d;
  string s;
  cin >> s;
  s = "." + s;
  vector<long long> dp(n + 1, 1e9);
  dp[1] = 0;
  for (long long i = 1; i <= n; ++i) {
    if (s[i] == '0') continue;
    for (long long k = 1; k <= d; ++k) {
      if (i + k <= n && s[i + k] == '1') {
        dp[i + k] = min(dp[i + k], dp[i] + 1);
      }
    }
  }
  if (dp[n] == 1e9)
    cout << -1;
  else
    cout << dp[n];
  return 0;
}
