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