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