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