#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<long> a;
  long n, k, d, time = 0;
  scanf("%ld%ld", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%ld", &d);
    a.push_back(d);
  }
  sort(a.begin(), a.end());
  for (int j = n - 1; j >= 0; j -= k) time += 2 * (a[j] - 1);
  printf("%ld\n", time);
  return 0;
}
