#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, total = 0;
  scanf("%d %d", &n, &k);
  int andares[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &andares[i]);
  }
  sort(andares, andares + n);
  for (int i = n - 1; i >= 0; i -= k) {
    total += (andares[i] - 1) * 2;
  }
  printf("%d\n", total);
}
