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