#include <bits/stdc++.h>
using namespace std;
int a[2010];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  int ans = 0, tmp = 0;
  for (int i = n - 1; i >= 0; i -= k) {
    ans += a[i] * 2 - 2;
  }
  cout << ans << endl;
  return 0;
}
