#include <bits/stdc++.h>
using namespace std;
bool arr[1000050];
bool r[1000][1000];
int ar[1000][1000];
int rr[2000050];
long long poww(long long a, long long b) {
  if (b == 0) return 1;
  long long res = 1;
  for (int i = 1; i <= b; ++i) res *= a;
  return res;
}
void get_prime() {
  for (int i = 2; i < 1001; i++) {
    if (arr[i] == 0) {
      for (int j = i * i; j < 1000007; j += i) arr[j] = 1;
    }
  }
}
int main() {
  long long n, k, c = 0;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> rr[i];
  }
  sort(rr, rr + n);
  for (int i = n - 1; i >= 0; i -= k) {
    c += (rr[i] - 1) * 2;
  }
  cout << c;
  return 0;
}
