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