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