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