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