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