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