#include <bits/stdc++.h>
using namespace std;
int f[2001], n, k;
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> f[i];
  sort(f, f + n);
  int32_t ans = 0, cnt = 0;
  int i = n - 1;
  do {
    if (cnt >= n) break;
    ans += (f[i] - 1) * 2;
    cnt += k;
    i -= k;
  } while (true);
  cout << ans << endl;
  return 0;
}
