#include <bits/stdc++.h>
using namespace std;
int n, d;
int a[105];
int dp[105];
int recur(int i) {
  if (i == n && a[i] == 1) {
    return 0;
  }
  if (dp[i] != -1) return dp[i];
  if (i > n || a[i] == 0) return 1000;
  int ans = 1000;
  for (int j = 1; j <= d; j++) {
    int smallAns = 1 + recur(i + j);
    ans = min(ans, smallAns);
  }
  return dp[i] = ans;
}
int main() {
  cin >> n >> d;
  string str;
  cin >> str;
  dp[0] = -1;
  for (int i = 1; i <= n; i++) {
    a[i] = str[i - 1] - '0';
    dp[i] = -1;
  }
  int ans = recur(1);
  if (ans >= 1000)
    cout << "-1\n";
  else
    cout << ans << "\n";
  return 0;
}
