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