#include <bits/stdc++.h>
using namespace std;
int n, k, ans, a[2010];
bool cmp(int x, int y) { return x > y; }
int main() {
  cin.sync_with_stdio(false);
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  sort(a + 1, a + n + 1, cmp);
  for (int i = 1; i <= n; ++i) {
    int maxim = -1, j;
    for (j = 1; j <= k && i <= n; ++j) {
      maxim = max(maxim, a[i]);
      ++i;
    }
    ans += 2 * (maxim - 1);
    --i;
  }
  cout << ans;
  return 0;
}
