#include <bits/stdc++.h>
using namespace std;
int const maxn = 2000 + 10;
int a[maxn];
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 + n + 1);
  int ans = 0;
  while (n > 0) {
    ans += 2 * (a[n] - 1);
    n -= k;
  }
  printf("%d\n", ans);
  scanf("%d", &n);
  return 0;
}
