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