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