#include <bits/stdc++.h>
#pragma GCC optimize("-O3")
using namespace std;
const long long N = 2e5 + 5;
long long n, k, dp[N];
vector<long long> v[N];
string s;
multiset<long long> s1, s2;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> k >> s, s = "$" + s, s2.insert(0);
  for (long long i = n; i >= 1; i--) {
    dp[i] = dp[i + 1] + i;
    if (i + k + 2 <= n + 1) s2.erase(s2.find(dp[i + k + 2]));
    for (long long j = 0; j < v[i].size(); j++) s1.erase(s1.find(v[i][j]));
    if (s1.size()) dp[i] = min(dp[i], *s1.begin());
    if (s[i] == '1') {
      long long cur = 0;
      if (s2.size()) cur = *s2.begin() + i;
      dp[i] = min(dp[i], cur);
      s1.insert(cur);
      if (i - k - 1 >= 1) v[i - k - 1].push_back(cur);
    }
    s2.insert(dp[i]);
  }
  cout << dp[1];
  return 0;
}
