#include <bits/stdc++.h>
using namespace std;
int n, d;
int now;
string s;
int ans;
int main() {
  cin >> n >> d;
  cin >> s;
  n--;
  while (now != n) {
    bool flag = 0;
    for (int i = now + d; i >= now + 1; --i) {
      if (s[i] == '1') {
        now = i;
        flag = 1;
        break;
      }
    }
    if (flag == 1)
      ans++;
    else {
      cout << -1;
      return 0;
    }
  }
  cout << ans;
  return 0;
}
