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