#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int a[2005];
  int i;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  int cost = 0;
  for (i = 0; i < n; i++) {
  }
  i = n - 1;
  while (i >= 0) {
    cost += (a[i] - 1);
    i = i - k;
  }
  cout << cost * 2;
  return 0;
}
