#include <bits/stdc++.h>
using namespace std;
int i, v, sum = 0, ctr = 0, t, k, n, j, flag = 0, x = 0, o = 0;
int a[100001];
int main() {
  sum = 0;
  cin >> n >> k;
  for (i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  if (n % k == 0) {
    for (i = n; (i - k) >= 1; i -= k) {
      sum = sum + (a[i] - 1) * 2;
    }
    sum += (a[i] - 1) * 2;
  } else {
    for (i = n; (i - k) >= 1; i -= k) {
      sum = sum + (a[i] - 1) * 2;
    }
    sum += (a[i] - 1) * 2;
  }
  cout << sum << endl;
  return 0;
}
