#include <bits/stdc++.h>
using namespace std;
const int tp0 = 1;
const int tp1 = 10;
const int tp2 = 100;
const int tp3 = 1000;
const int tp4 = 10000;
const int tp5 = 100000;
const int tp6 = 1000000;
const int tp7 = 10000000;
const int tp8 = 100000000;
const int tp9 = 1000000000;
const int mod = 1000000000 + 7;
string s;
int ans = 0;
int d;
int dp(int x) {
  if (x == 1) return 0;
  if (x == -1) {
    ans = -1;
    return -1;
  }
  ans++;
  int root = x;
  for (int i = 1; i <= d; i++) {
    if (x - i > 0 and s[x - i - 1] == '1') root = x - i;
  }
  if (root == x)
    return -1;
  else
    return dp(root);
}
int main() {
  int ted = 0, n;
  cin >> n >> d >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '0')
      ted++;
    else {
      if (ted >= d) {
        cout << -1;
        return 0;
      }
      ted = 0;
    }
  }
  dp(n);
  cout << ans;
}
