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