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