#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, arr[2002], ans, end, i, arr2[2002];
  cin >> n >> k;
  for (i = 0; i < n; i++) {
    cin >> arr2[i];
  }
  sort(arr2, arr2 + n);
  for (i = 0; i < n; i++) {
    arr[i] = arr2[n - i - 1];
  }
  if (n <= k) {
    cout << arr[0] * 2 - 2 << endl;
  } else {
    ans = 0;
    for (i = 0; i < n; i += k) {
      ans += (2 * arr[i] - 2);
    }
    cout << ans << endl;
  }
  return 0;
}
