#include <bits/stdc++.h>
using namespace std;
int p[3000];
bool cmp(int a, int b) { return a > b; }
int main() {
  int n, k;
  int sum;
  while (~scanf("%d %d", &n, &k)) {
    for (int i = 1; i <= n; i++) {
      scanf("%d", &p[i]);
    }
    sort(p + 1, p + n + 1, cmp);
    sum = 0;
    for (int i = 0; i < n / k; i++) {
      sum += (p[i * k + 1] - 1) * 2;
    }
    if (n % k != 0) {
      sum += (p[n / k * k + 1] - 1) * 2;
    }
    printf("%d\n", sum);
  }
  return 0;
}
