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