#include <bits/stdc++.h>
using namespace std;
int n, k, sum[2001], x, mx = 0, b[2001], was[2001], m, i, flow, ans, ans1,
                        a[2001][2001], last;
int main() {
  cin >> n >> k;
  for (i = 1; i <= n; i++) cin >> b[i];
  sort(b + 1, b + n + 1);
  for (i = n; i >= 1; i -= k) ans += (b[i] - 1) * 2;
  cout << ans;
  return 0;
}
