#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> arr;
  int c;
  for (int i = 0; i < n; i++) {
    cin >> c;
    arr.push_back(c);
  }
  int floor = 1;
  int sum = 0;
  sort(arr.rbegin(), arr.rend());
  for (int i = 0; i < arr.size(); i++) {
    sum += abs(arr[i] - floor) * 2;
    for (int j = 0; j < k - 1; j++, i++)
      ;
  }
  cout << sum << endl;
  return 0;
}
