#include <bits/stdc++.h>
using namespace std;
const long long int N = 1e6, N2 = 1e8, delta = 46639, inf = 5e7;
const long double PI = 3.141592653589793;
long long int a[N], ps[N], dp[N];
vector<long long int> v;
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long int n, d, cnt = 0, mx = 0;
  string s;
  cin >> n >> d >> s;
  for (long long int i = 0; i < n; i++) {
    if (s[i] == '0')
      cnt++;
    else
      cnt = 0;
    mx = max(mx, cnt);
  }
  if (mx >= d) return cout << (-1), 0;
  dp[0] = 0;
  for (long long int i = 1; i < n; i++) {
    if (s[i] == '1') {
      long long int x = max(i - d, 0ll);
      for (long long int j = x; j < i; j++) {
        if (s[j] == '1') {
          dp[i] = dp[j] + 1;
          break;
        }
      }
    }
  }
  if (!dp[n - 1]) return cout << (-1), 0;
  return cout << (dp[n - 1]), 0;
}
