#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > g;
vector<int> used;
long long ans;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, x;
  cin >> n >> x;
  string s;
  cin >> s;
  queue<int> q;
  vector<int> d(111), used(111);
  q.push(0);
  used[0] = 1;
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    for (int i = 0; v + i < n && i <= x; i++) {
      if (s[v + i] == '1' && !used[v + i]) {
        q.push(v + i);
        used[v + i] = 1;
        d[v + i] = d[v] + 1;
      }
    }
  }
  if (!used[n - 1]) {
    cout << -1;
  } else {
    cout << d[n - 1];
  }
  return 0;
}
