#include <bits/stdc++.h>
using namespace std;
const unsigned long long N = 2000001;
signed main() {
  unsigned long long n, d;
  cin >> n >> d;
  vector<char> ch(n);
  for (unsigned long long i = 0; i < n; i++) cin >> ch[i];
  unsigned long long pos = 0;
  bool flag = true;
  unsigned long long count = 0;
  for (unsigned long long i = 0; i < n - 1;) {
    if (i + d > n - 1) {
      count++;
      break;
    }
    pos = i;
    for (unsigned long long j = i + d; j >= i; j--) {
      if (ch[j] == '1') {
        i = j;
        break;
      }
    }
    if (pos == i) {
      flag = false;
      break;
    }
    count++;
  }
  if (flag)
    cout << count << "\n";
  else
    cout << "-1";
}
