#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n;
  long int k;
  scanf("%ld", &n);
  scanf("%ld", &k);
  long int* personas = new long int[n];
  for (long int i = 0; i < n; i = -~i) {
    scanf("%ld", &(*(personas + i)));
  }
  sort(personas, personas + n, greater<long int>());
  long int segundos = 0;
  for (long int i = 0; i < n; i += k) {
    segundos += 2 * (*(personas + i) - 1);
  }
  printf("%ld\n", segundos);
  delete[] personas;
  return 0;
}
