#include <bits/stdc++.h>
using namespace std;
const int mxn = 1e5 + 1;
long long n, d;
long long dp[201];
string s;
long long solve(long long i) {
  if (i >= n - 1) return 0;
  long long h;
  if (dp[i] != -1) return dp[i];
  long long ans = 1e18;
  for (h = 1; h < d + 1; h++) {
    long long nx = min(i + h, n - 1);
    if (s[nx] == '1') ans = min(ans, 1 + solve(nx));
  }
  return dp[i] = ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    cin >> n >> d;
    cin >> s;
    memset(dp, -1, sizeof(dp));
    long long ans = solve(0);
    if (ans == 1e18) ans = -1;
    cout << ans;
  }
  return 0;
}
