#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int t = 0, i = 0, j = 0, n = 0, m, k = 0, num = 0, temp = 0, ind;
  cin >> n >> k;
  string str;
  int arr[2002] = {0};
  for (i = 0; i < n; ++i) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  for (i = n - 1; i >= 0; i -= k) {
    num += 2 * (arr[i] - 1);
  }
  cout << num;
  return 0;
}
