#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long expo(long long x, long long y) {
  long long res = 1;
  while (y) {
    if (y % 2) res = (res * x % mod) % mod;
    x = (x * x) % mod;
    y /= 2;
  }
  return res;
}
long long inv(long long x) { return expo(x, mod - 2); }
long long add(long long x, long long y) { return (x + y) % mod; }
long long sub(long long x, long long y) { return (x - y) % mod; }
long long mul(long long x, long long y) {
  return ((x % mod) * (y % mod)) % mod;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, d;
  cin >> n >> d;
  string s;
  cin >> s;
  long long val = 0, ans = 0, no = 0;
  while (val != n - 1) {
    long long st = val;
    long long end = min(val + d, n - 1);
    while (s[end] != '1') {
      end--;
    }
    if (end == st) {
      no = 1;
      break;
    }
    val = end;
    ans++;
  }
  if (no) {
    cout << "-1\n";
  } else
    cout << ans << "\n";
}
