#include <bits/stdc++.h>
using namespace std;
long long a, b, c, sh = 0;
string s;
void func(long long op) {
  c = op;
  if (op == a - 1) {
    cout << sh;
    return;
  }
  for (int i = b; i > 0; i--) {
    if (s[op + i] == '1') {
      sh++;
      func(op + i);
      return;
    }
  }
  return;
}
int main() {
  cin >> a >> b;
  c = b;
  cin >> s;
  if (s[a - 1] != '1') {
    cout << "NO";
  }
  func(0);
  if (c != a - 1) {
    cout << -1;
  }
}
