#include <bits/stdc++.h>
using namespace std;
int indix = 0;
int sum = 0;
int minn = 101;
int main() {
  int n, x, i;
  string s;
  cin >> n >> x;
  cin >> s;
  int c = x - 1;
  int g = 0;
  for (i = 0; i < s.length(); i += g) {
    if (i == s.length() - 1) {
      break;
    }
    g = 0;
    c = x - 1;
    if (s[i + x] == '1') {
      sum++;
      g += x;
    } else {
      while (c != 0) {
        if (s[i + c] == '1') {
          sum++;
          g += c;
          break;
        }
        c--;
      }
      if (c == 0) {
        cout << "-1";
        return 0;
      }
    }
  }
  cout << sum;
  return 0;
}
