#include <bits/stdc++.h>
using namespace std;
int n, a, b, c, d, k;
void solve() {
  int res = 0;
  scanf("%d%d", &n, &k);
  vector<int> V;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a);
    a--;
    V.push_back(a);
  }
  sort(V.begin(), V.end());
  while (V.size()) {
    res += V.back() * 2;
    for (int i = 1; i <= k && V.size(); i++) {
      V.pop_back();
    }
  }
  printf("%d\n", res);
}
int main() { solve(); }
