#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, i, x, j, sum = 0, m;
  vector<long long> v;
  cin >> n >> k;
  for (i = 0; i < n; ++i) {
    cin >> x;
    v.push_back(x);
  }
  sort(v.begin(), v.end());
  for (i = n - 1; i >= 0; i -= k) {
    m = 0;
    for (j = i; j > (i - k) && j >= 0; --j) {
      m = max(m, v[j]);
    }
    sum += ((m - 1) * 2);
  }
  cout << sum;
}
