#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e6 + 7;
const int INF = 1e9;
const long long INFF = 1e18;
int flag[maxn];
int ok[maxn];
char s[maxn];
struct node {
  int x;
  int num;
} sx, n1, n2;
int n, d;
int bfs(int x, int num, int n) {
  queue<node> q;
  while (!q.empty()) q.pop();
  sx.x = x;
  sx.num = num;
  q.push(sx);
  flag[sx.x] = 1;
  while (!q.empty()) {
    n1 = q.front();
    q.pop();
    if (n1.x == n) {
      return n1.num;
    }
    for (int i = 1; i <= d; i++) {
      n2.x = n1.x + i;
      if (flag[n2.x] || !ok[n2.x]) continue;
      n2.num = n1.num + 1;
      q.push(n2);
      flag[n2.x] = 1;
    }
  }
  return -1;
}
int main() {
  cin >> n >> d;
  cin >> (s + 1);
  int l = strlen(s + 1);
  memset(ok, 0, sizeof ok);
  for (int i = 1; i <= n; i++) {
    if (s[i] == '1') ok[i] = 1;
  }
  cout << bfs(1, 0, n) << endl;
  return 0;
}
