#include <bits/stdc++.h>
void sort(int a[], int l, int r) {
  int pivot, i, j, q, temp;
  if (l < r) {
    pivot = a[r];
    i = l - 1;
    for (j = l; j <= r - 1; j++) {
      if (a[j] > pivot) {
        i++;
        temp = a[i];
        a[i] = a[j];
        a[j] = temp;
      }
    }
    temp = a[i + 1];
    a[i + 1] = a[r];
    a[r] = temp;
    q = i + 1;
    sort(a, l, q - 1);
    sort(a, q + 1, r);
  }
}
int main() {
  int i, n, k, sum = 0;
  scanf("%d%d", &n, &k);
  int f[n];
  for (i = 0; i < n; i++) scanf("%d", &f[i]);
  sort(f, 0, n - 1);
  for (i = 0; i < n; i += k) {
    sum += (f[i] - 1) * 2;
  }
  printf("%d", sum);
  return 0;
}
