#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n, k, i, sec, a;
  cin >> n >> k;
  vector<int> F;
  for (i = 0; i < n; i++) {
    cin >> a;
    F.push_back(a);
  }
  sort(F.begin(), F.end());
  sec = 0;
  for (i = n - 1; (i - k) >= 0; i -= k) {
    sec += 2 * (F[i] - 1);
  }
  if (i >= 0) sec += 2 * (F[i] - 1);
  cout << sec << "\n";
}
