#include <bits/stdc++.h>
using namespace std;
long long arr[100000];
int main() {
  long long n, k;
  cin >> n >> k;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    arr[x]++;
  }
  long long p = 1;
  long long tot = n;
  long long ans = 0;
  for (long long i = 2; i < 100000; i++) {
    if (tot == 0) break;
    if (arr[i] > 0) {
      long long y = (tot / k);
      if (tot % k != 0) y++;
      ans += (2 * y - 1) * (i - p);
      tot = tot - arr[i];
      p = i;
    }
  }
  ans = ans + p - 1;
  cout << ans << endl;
  return 0;
}
