#include <bits/stdc++.h>
using namespace std;
const long long MOD = (1e9) + 7;
const long long inf = 1e17;
const int N = 100005;
int dp[111];
string s;
int main() {
  int n, d;
  scanf("%d", &n), scanf("%d", &d);
  cin >> s;
  s = ' ' + s;
  memset(dp, MOD, sizeof dp);
  dp[1] = 0;
  for (int i = 1; i <= n; i++) {
    if (s[i] == '0') continue;
    for (int j = 1; j <= d; j++) {
      if (i > j) dp[i] = min(dp[i], dp[i - j] + 1);
    }
  }
  if (dp[n] > 101)
    cout << "-1";
  else
    cout << dp[n];
  return 0;
}
