#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, K;
  cin >> N >> K;
  int Person[3000] = {};
  for (int i = 0; i < N; i++) {
    cin >> Person[i];
  }
  sort(Person, Person + N);
  int Sum = 0;
  int tem = (ceil((double)N / K));
  Sum += (Person[0] - 1) * ((tem * 2) - 1);
  int Count = 1;
  for (int i = 1; i < N; i++) {
    tem = ceil((double)(N - Count) / K);
    Sum += (Person[i] - Person[i - 1]) * ((tem * 2) - 1);
    Count++;
  }
  Sum += Person[N - 1] - 1;
  cout << Sum << endl;
  return 0;
}
