#include <bits/stdc++.h>
using namespace std;
int n, d, dp[105], flg;
string str;
int main(int argc, char** argv) {
  cin >> n >> d;
  cin >> str;
  dp[0] = 0;
  for (int i = 1; i < n; i++) {
    if (str[i] == '0') continue;
    dp[i] = INT_MAX;
    flg = 0;
    for (int j = i - 1; j >= 0 && j >= i - d; j--) {
      if (str[j] == '0') {
        continue;
      }
      dp[i] = min(dp[i], dp[j] + 1);
      flg = 1;
    }
    if (!flg) {
      cout << "-1" << endl;
      return 0;
    }
  }
  cout << dp[n - 1] << endl;
  return 0;
}
