#include <bits/stdc++.h>
using namespace std;
int main(int argc, char* argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int N, K;
  cin >> N >> K;
  priority_queue<int> PQ;
  for (int n = 0; n < N; ++n) {
    int f;
    cin >> f;
    PQ.push(f);
  }
  long long res = 0;
  for (int t = 1; !PQ.empty(); ++t) {
    int f = PQ.top();
    for (int k = 0; k < K && !PQ.empty(); ++k) {
      PQ.pop();
    }
    res += 2 * (f - 1);
  }
  cout << res << "\n";
  return 0;
}
