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