#include <bits/stdc++.h>
using namespace std;
long long dx[] = {-1, -1, -1, 0, 0, 1, 1, 1};
long long dy[] = {-1, 0, 1, -1, 1, -1, 0, 1};
const long double pi = 3.1415926535897932384626433832795;
const long long INF = 1e18;
const long long mod = 1000000007;
const long long maxn = 1e5 + 5;
template <typename T>
void printv(const vector<T>& v) {
  for (auto i : v) cout << i << ' ';
  cout << '\n';
}
template <typename T>
void printv(const vector<pair<T, T>>& v) {
  for (auto p : v) cout << "(" << p.first << "," << p.second << "),";
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr);
  long long n, d;
  cin >> n >> d;
  string s;
  cin >> s;
  vector<long long> dp(n, INF);
  dp[0] = 0;
  for (long long i = 1; i < n; i++) {
    if (s[i] == '0') continue;
    for (long long j = 1; j <= d; j++) {
      if (i - j >= 0) {
        dp[i] = min(dp[i], dp[i - j] + 1);
      }
    }
  }
  if (dp[n - 1] >= INF)
    cout << -1 << '\n';
  else
    cout << dp[n - 1] << '\n';
  return 0;
}
