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