#include <bits/stdc++.h>
using namespace std;
int compare(const void* a, const void* b) { return (*(int*)a - *(int*)b); }
int main() {
  int n, k, a[2005];
  cin >> n >> k;
  int m = n, i = 0;
  while (m--) {
    cin >> a[i++];
  }
  qsort(a, n, sizeof(int), compare);
  if (k >= n) {
    cout << 2 * (a[n - 1] - 1) << endl;
  } else {
    int ans = 0;
    for (int i = n - 1; i >= 0;) {
      ans += 2 * (a[i] - 1);
      i -= k;
    }
    cout << ans << endl;
  }
  return 0;
}
