#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, k;
  cin >> n >> k;
  int first[2001] = {0};
  for (int i = 0, x; i < n; i++) cin >> first[i];
  sort(first, first + n);
  reverse(first, first + n);
  int sum = 0;
  for (int i = 0; i < n; i += k) sum += 2 * (first[i] - 1);
  cout << sum << "\n";
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
