#include <bits/stdc++.h>
using namespace std;
int x, n, k, i, c[100001], lf, cnt;
int main() {
  scanf("%d%d", &n, &k);
  for (i = 0; i < n; i++) {
    scanf("%d", &c[i]);
  }
  sort(c, c + n);
  if (k >= n) {
    cout << c[n - 1] * 2 - 2 << endl;
    return 0;
  }
  for (i = n - 1; i >= 0; i--) {
    cnt = 0;
    x = c[i];
    while (i >= 0 && cnt < k) {
      cnt++;
      i--;
    }
    lf += x - 1;
    lf += x - 1;
    i++;
  }
  cout << lf << endl;
  return 0;
}
