#include <bits/stdc++.h>
using namespace std;
struct __timestamper {};
int main() {
  int n, k;
  while (scanf("%d%d", &n, &k) == 2) {
    vector<int> f(n);
    for (int& x : f) scanf("%d", &x);
    sort(f.rbegin(), f.rend());
    int ans = 0;
    for (int i = 0; i < (int)f.size(); i += k) ans += (f[i] - 1) * 2;
    printf("%d\n", ans);
  }
  return 0;
}
