#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 5;
const long long inf = 1e11;
const long long mod = 1e9 + 7;
class segment_Tree_min {
  class node {
   public:
    int l, r;
    long long lazy;
    long long min;
  };
  void pushdown(int root) {
    if (tree[root].lazy) {
      tree[root << 1].min = tree[root].lazy;
      tree[root << 1 | 1].min = tree[root].lazy;
      tree[root << 1].lazy = tree[root].lazy;
      tree[root << 1 | 1].lazy = tree[root].lazy;
      tree[root].lazy = 0;
    }
  }
  void pushup(int root) {
    tree[root].min = min(tree[root << 1].min, tree[root << 1 | 1].min);
  }
  int n;
  vector<node> tree;

 public:
  vector<long long> array;
  segment_Tree_min(int _n) : n(_n), tree((_n + 1) << 2), array(_n + 1){};
  void build(int l, int r, int root = 1) {
    tree[root].l = l;
    tree[root].r = r;
    tree[root].lazy = 0;
    if (l == r) {
      tree[root].min = inf;
      return;
    }
    int mid = (l + r) >> 1;
    build(l, mid, root << 1);
    build(mid + 1, r, root << 1 | 1);
    pushup(root);
  }
  void updata(int l, int r, long long val, int root = 1) {
    if (l <= tree[root].l && r >= tree[root].r) {
      tree[root].min = val;
      tree[root].lazy = val;
      return;
    }
    pushdown(root);
    int mid = (tree[root].l + tree[root].r) >> 1;
    if (l <= mid) updata(l, r, val, root << 1);
    if (r > mid) updata(l, r, val, root << 1 | 1);
    pushup(root);
  }
  long long query(int l, int r, int root = 1) {
    if (l <= tree[root].l && r >= tree[root].r) {
      return tree[root].min;
    }
    pushdown(root);
    int mid = (tree[root].l + tree[root].r) >> 1;
    long long Min = inf;
    if (l <= mid) {
      Min = min(query(l, r, root << 1), Min);
    }
    if (r > mid) {
      Min = min(query(l, r, root << 1 | 1), Min);
    }
    return Min;
  }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  segment_Tree_min T(n), T1(n);
  T.build(1, n);
  T1.build(1, n);
  vector<vector<long long>> dp(n + 1, vector<long long>(2, inf));
  dp[0][0] = 0;
  for (int i = 1; i <= n; ++i) {
    dp[i][0] = min(dp[i - 1][0] + i, T1.query(max(1, i - k), i - 1));
    if (s[i - 1] == '1') {
      if (i - k - 1 <= 0) {
        dp[i][1] = 0;
      } else {
        dp[i][1] = min(T.query(i - k - 1, i - 1), T1.query(i - k - 1, i - 1));
      }
      dp[i][1] += i;
    }
    T.updata(i, i, dp[i][0]);
    T1.updata(i, i, dp[i][1]);
  }
  cout << min(dp[n][0], dp[n][1]) << endl;
  return 0;
}
