#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll maxs = 1e3 + 5;
vector<ll> graph[maxs];
bool vis[maxs];
ll dist[maxs];
void bfs(ll s, ll d) {
  vis[s] = true;
  dist[s] = 0;
  queue<ll> q;
  q.push(s);
  while (!q.empty()) {
    s = q.front();
    q.pop();
    vis[s] = true;
    for (auto it : graph[s]) {
      if (!vis[it] && ((s + d) >= it)) {
        vis[it] = true;
        dist[it] = dist[s] + 1;
        q.push(it);
      }
    }
  }
}
int main() {
  ll n, d, i, j;
  cin >> n >> d;
  string s;
  cin >> s;
  for (i = 0; i < n; i++) {
    if (s[i] == '1') {
      for (j = i + 1; j < n; j++) {
        if (s[j] == '1') graph[i].push_back(j);
      }
    }
  }
  bfs(0, d);
  if (vis[n - 1] == false)
    cout << -1;
  else
    cout << dist[n - 1];
}
