#include <bits/stdc++.h>
using namespace std;
int dp[105];
int fn(int n, int d, string s) {
  for (int i = 2; i <= n; i++) {
    int ans = (int)(1e4);
    if (s[i - 1] == '0') continue;
    for (int j = i - 1; j >= max(1, i - d); j--) {
      ans = min(ans, dp[j]);
    }
    dp[i] = ans + 1;
  }
  return dp[n];
}
int main() {
  int n, d;
  cin >> n >> d;
  string s;
  cin >> s;
  for (int i = 0; i <= n; i++) dp[i] = (int)(1e4);
  dp[0] = dp[1] = 0;
  int ans = fn(n, d, s);
  if (ans < (int)(1e4))
    cout << ans << endl;
  else
    cout << "-1\n";
}
