#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  while (cin >> n >> k) {
    vector<int> v(n);
    for (int i = 0; i < n; i++) cin >> v[i];
    sort(((v).rbegin()), ((v).rend()));
    int j = 0, ans = 0;
    while (j < n) ans += (v[j] * 2 - 2), j += k;
    cout << ans << endl;
  }
  return 0;
}
