#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long N1 = 2e5 + 10;
int code() {
  long long n, d;
  string s;
  cin >> n >> d >> s;
  int cnt = 0;
  long long i = 0;
  while (i < n - 1) {
    bool flag = 0;
    for (long long j = min(i + d, n - 1); j > i; --j) {
      if (s[j] == '1') {
        ++cnt, i = j;
        flag = 1;
        break;
      }
    }
    if (flag == 0) {
      cout << -1;
      return 0;
    }
  }
  cout << cnt;
  return 0;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long tc = 1;
  for (long long i = 0; i < (tc); ++i) code();
  return 0;
}
