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