#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int a[n + 1];
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i < n; i++) {
    int j = i;
    while (j > 0 && a[j] > a[j + 1]) {
      int tmp = a[j];
      a[j] = a[j + 1];
      a[j + 1] = tmp;
      j--;
    }
  }
  long long ans = 0;
  for (int i = n; i >= 1; i -= k) {
    ans += (a[i] - 1) * 2;
  }
  cout << ans << endl;
}
