#include <bits/stdc++.h>
using namespace std;
int compare(const void *a, const void *b) { return (*(int *)b - *(int *)a); }
int main() {
  int n, k;
  cin >> n >> k;
  int *f1 = new int[n];
  for (int i = 0; i < n; i++) cin >> f1[i];
  qsort(f1, n, sizeof(int), compare);
  int j = 0;
  int sum = 0;
  while (j < n) {
    sum += 2 * (f1[j] - 1);
    j = j + k;
  }
  cout << sum;
  return 0;
}
