#include <bits/stdc++.h>
using namespace std;
long long n, k, tab[2005], w, x, minn, pom[2005], ile, czo = 1, ktory;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> tab[i];
  sort(tab, tab + n);
  if (n >= k) {
    for (int i = n - 1; i >= 0;) {
      w += ((tab[i] - 1) * 2);
      i -= k;
    }
  } else
    w = ((tab[n - 1] - 1) * 2);
  cout << w << "\n";
  return 0;
}
