#include <bits/stdc++.h>
using namespace std;
const long long inf = 0x3f3f3f3f3f3f3f3fll;
template <class class_name>
void print_vector(vector<class_name> vec) {
  cout << endl;
  for (auto item : vec) {
    cout << item << " ";
  }
  cout << endl;
}
void solve() {
  long long n, d, curr = 0, i = 0, cnt = 0;
  cin >> n >> d;
  string s;
  cin >> s;
  while (i < n) {
    long long flag = 0;
    for (long long j = ((i + d) < (n - 1) ? (i + d) : (n - 1)); j > i; j--) {
      if (s[j] == '1') {
        curr = j;
        cnt++;
        flag = 1;
        break;
      }
    }
    if (flag == 0) {
      break;
    } else {
      i = curr;
    }
  }
  if (curr == n - 1) {
    cout << cnt << endl;
  } else {
    cout << -1 << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  for (int it = 1; it <= t; it++) {
    solve();
  }
  return 0;
}
