#include <bits/stdc++.h>
using namespace std;
vector<int> v[100005], ans;
int vis[100005], n, m, k, i, j, lang;
void dfs(int node) {
  vis[node] = 1;
  int flag = 1;
  for (int child : v[node]) {
    if (vis[child] == 0) dfs(child);
  }
}
int main() {
  int flag = 1, s = 0, i, j, k, bz = 0, mx = 0;
  cin >> n >> m;
  string a;
  cin >> a;
  for (i = 1; i < n - 1; i++) {
    if (a[i] == '0') {
      bz++;
    } else {
      bz = 0;
    }
    mx = max(mx, bz);
  }
  for (i = 0; i < n; i++) {
    k = -1;
    for (j = i + 1; j <= i + m && j < n; j++) {
      if (a[j] == '1') {
        k = j;
      }
    }
    if (k == -1) {
      break;
    } else {
      s++;
      i = k - 1;
      continue;
    }
  }
  if (mx < m)
    cout << s;
  else
    cout << -1;
}
