#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t, ans = 0, num;
  vector<int> v;
  cin >> n >> t;
  for (int i = 0; i < n; i++) {
    cin >> num;
    v.push_back(num);
  }
  sort(v.begin(), v.end());
  while (!v.empty()) {
    ans += (v[v.size() - 1] - 1) * 2;
    for (int j = 0; j < t; j++) {
      v.pop_back();
      if (v.empty()) break;
    }
  }
  cout << ans << endl;
  return 0;
}
