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