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