#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int n, d, x[N];
int dp[N];
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> d;
  cin >> s;
  memset(dp, 1e9 + 7, sizeof(dp));
  dp[0] = 0;
  for (int i = 1; i < n; i++) {
    for (int a = i; a >= max(0, i - d); a--) {
      if (s[a] == '1') dp[i] = min(dp[i], dp[a] + 1);
    }
  }
  if (dp[n - 1] > n)
    cout << -1;
  else
    cout << dp[n - 1];
  return 0;
}
