#include <bits/stdc++.h>
using namespace std;
const int MAX_ = 10000 + 5;
const int INF = 0x3f3f3f3f;
string s;
int n, m;
int dp[1000];
int dfs(int num) {
  if (dp[num] != -1) return dp[num];
  if (num == 0) return 0;
  int ans = INF;
  for (int i = 1; i <= m && i <= num; i++) {
    if (s[num - i] == '1') {
      ans = min(dfs(num - i), ans);
    }
  }
  dp[num] = ans + 1;
  return ans + 1;
}
int main() {
  cin >> n >> m;
  cin >> s;
  for (int i = 0; i < 1000; i++) dp[i] = -1;
  int ans1 = dfs(n - 1);
  if (ans1 == INF + 1)
    cout << -1 << endl;
  else
    cout << ans1 << endl;
  return 0;
}
