#include <bits/stdc++.h>
using namespace std;
const int max_n = 2e3 + 10;
int f[max_n];
int n, k;
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> f[i];
  sort(f, f + n);
  int ans = 0, cur = n % k;
  if (cur) ans += 2 * (f[cur - 1] - 1);
  while (cur != n) {
    cur += k;
    ans += 2 * (f[cur - 1] - 1);
  }
  cout << ans << endl;
  return 0;
}
