#include <bits/stdc++.h>
const int high_int = 10000;
using namespace std;
int f[150];
int a[150];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, d;
  cin >> n >> d;
  memset(f, 0, sizeof(f));
  ;
  string s;
  cin >> s;
  for (int i = 1; i <= n; i++) a[i] = (int)s[i - 1] - 48;
  for (int i = 2; i <= n; i++) {
    if (a[i] != 0) {
      f[i] = high_int;
      for (int j = i - d; j < i; j++) {
        if (f[j] != 0 || j == 1) {
          f[i] = min(f[i], f[j] + 1);
        }
      }
    }
  }
  if (f[n] == high_int)
    cout << -1;
  else
    cout << f[n];
  return 0;
}
