#include <bits/stdc++.h>
using namespace std;
long long int ans[200009];
string s;
vector<pair<int, long long int>> v;
bool fun(pair<int, long long int> p1, pair<int, long long int> p2) {
  return (p1.first < p2.first);
}
int main() {
  int i, j, k, x, y, m, q, idx1, idx2, t, f, i1, j1, z, n;
  scanf("%d%d", &n, &m);
  cin >> s;
  s = '#' + s;
  if (s[1] == '1') {
    v.push_back(make_pair(1, 1));
  }
  ans[1] = 1;
  long long int z1, z2;
  for (i = 2; i <= n; i++) {
    ans[i] = ans[i - 1] + 1ll * i;
    j = lower_bound(v.begin(), v.end(), make_pair(max(1, i - m), -1 * 1ll),
                    fun) -
        v.begin();
    if (s[i] == '1') {
      if (j < ((long long int)(v).size())) ans[i] = min(ans[i], v[j].second);
      long long int zz =
          min(ans[max(1, i - m) - 1],
              (((long long int)(v).size()) == j) ? ans[i] : ans[v[j].first]) +
          1ll * i;
      ans[i] = min(ans[i], zz);
      v.push_back(make_pair(i, zz));
    } else {
      if (j < ((long long int)(v).size())) ans[i] = min(ans[i], v[j].second);
    }
  }
  cout << ans[n] << endl;
  ;
  return 0;
}
