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