#include <bits/stdc++.h>
using namespace std;
int n, k, a[110];
string s;
int main() {
  cin >> n >> k;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (i > 0) a[i] = -1;
    if (s[i] == '0') continue;
    for (int j = i - 1; j >= (i >= k ? i - k : 0); j--) {
      if (s[j] == '1' && a[j] != -1) a[i] = a[j] + 1;
    }
  }
  cout << a[n - 1] << endl;
  return 0;
}
