#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n, k, x;
  cin >> n >> k;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    cin >> x;
    v.push_back(x);
  }
  sort(v.begin(), v.end(), std::greater<int>());
  long long ans = 0;
  int j = 0;
  while (j < n) {
    int b = v[j];
    j += k;
    ans += 2ll * (b - 1);
  }
  cout << ans;
  return 0;
}
