#include <bits/stdc++.h>
using namespace std;
long long T, C = 1, N;
void process() {
  int n, k;
  cin >> n >> k;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    int idx;
    cin >> idx;
    v.push_back(idx);
  }
  sort(v.begin(), v.end());
  int ans = 0;
  for (int i = (int)v.size() - 1; i >= 0; i -= k) {
    ans += (2 * (v[i] - 1));
  }
  cout << ans << endl;
  return;
}
int main() {
  process();
  return 0;
}
