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