#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
using std::map;
using std::min;
using std::sort;
using std::string;
int main() {
  int n, k;
  cin >> n >> k;
  int data[2000] = {
      0,
  };
  int i;
  for (i = 0; i < n; i++) {
    cin >> data[i];
  }
  int answer = 0;
  sort(data, data + n);
  for (i = n - 1; i >= 0; i -= k) {
    answer += 2 * (data[i] - 1);
  }
  cout << answer;
  return 0;
}
