#include <bits/stdc++.h>
using namespace std;
void sort(int temp[2000], int start, int end) {
  int flag;
  for (int i = start; i < end - 1; i++) {
    for (int j = start; j < end - i - 1; j++) {
      if (temp[j] < temp[j + 1]) {
        flag = temp[j];
        temp[j] = temp[j + 1];
        temp[j + 1] = flag;
      }
    }
  }
}
int main() {
  int n, k, arr[2000], count = 0;
  cin >> n;
  cin >> k;
  cout << "\n";
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr, 0, n);
  for (int i = 0; i < n; i += k) count = count + (2 * (arr[i] - 1));
  cout << "\n" << count;
  return 0;
}
