#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, s = 0, t, j, i, mode;
  cin >> n;
  cin >> k;
  int a[n];
  for (i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  while (n > 0) {
    s = s + 2 * (a[n - 1] - 1);
    n = n - k;
  }
  cout << s << endl;
  return 0;
}
