#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, c, sum = 0;
  vector<int> q;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> c;
    q.push_back(c - 1);
  }
  sort(q.begin(), q.end());
  for (int i = (int)q.size() - 1; i >= 0; i -= k) sum += q[i] * 2;
  cout << sum;
  return 0;
}
