#include <bits/stdc++.h>
using namespace std;
double sqr(double x) { return x * x; }
double distsqr(double x, double y, double a, double b) {
  return sqr((x - a)) + sqr((y - b));
}
double cosine_angle(double a, double b, double c) {
  return (double)(sqr(a) + sqr(b) - sqr(c)) / ((double)2.0 * a * b);
}
bool pr[1000050];
int prime[1000050 / 10];
void PrimeGen() {
  int i, j, k, l = sqrt(1000050) + 1;
  pr[0] = pr[1] = 1;
  for (i = 4; i < 1000050; i += 2) pr[i] = 1;
  for (i = 3; i < l; i += 2) {
    if (!pr[i])
      for (j = i * i, k = i << 1; j < 1000050; j += k) pr[j] = 1;
  }
  for (i = j = 0; i < 1000050; i++)
    if (!pr[i]) prime[j++] = i;
}
int Comp(const void *a, const void *b) { return *(int *)b - *(int *)a; }
int num[2001];
int main() {
  int i, n, k, m, time;
  scanf("%d %d", &n, &k);
  for (i = 0; i < n; i++) scanf("%d", &num[i]);
  qsort(num, n, sizeof(int), Comp);
  for (i = time = 0; i < n; i += k) {
    time += num[i] - 1;
  }
  printf("%d\n", time << 1);
  return 0;
}
