#include <bits/stdc++.h>
using namespace std;
long long n, k, f[2222], ans;
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> f[i];
  }
  sort(f, f + n);
  reverse(f, f + n);
  for (int i = 0; i < n; i += k) ans += 2 * f[i] - 2;
  cout << ans;
  return 0;
}
