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