#include <bits/stdc++.h>
using namespace std;
int f[2001];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> f[i];
  }
  sort(f, f + n);
  int time = 0;
  for (int i = n - 1; i >= 0; i = i - k) {
    time += (f[i] - 1);
  }
  cout << time * 2 << endl;
}
