#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
int n, k, m;
int a[4000];
void Run() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  long long res = 0;
  int i = n;
  while (i > 0) {
    res += 2 * a[i] - 2;
    i -= k;
  }
  cout << res;
}
int main() {
  ios_base::sync_with_stdio(0);
  Run();
  return 0;
}
