#include <bits/stdc++.h>
using namespace std;
const int dx[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dy[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
const int MAX = 2 * 1000 * 1000 + 10;
const long long INF = 1e18;
const int MOD = 1e9 + 7;
int dp[MAX];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  for (int i = 0; i < MAX; i++) {
    dp[i] = MAX;
  }
  dp[0] = 0;
  int n, d;
  string s;
  cin >> n >> d >> s;
  for (int i = 0; i < n; i++) {
    for (int j = 1; j <= d and i - j >= 0; j++)
      if (s[i - j] != '0') dp[i] = min(dp[i], 1 + dp[i - j]);
  }
  if (dp[n - 1] == MAX)
    cout << -1 << '\n';
  else
    cout << dp[n - 1] << '\n';
}
