#include <bits/stdc++.h>
const long long mod = 1e9 + 7;
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, k;
  cin >> n >> k;
  vector<long long> v(n);
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
    v[i]--;
  }
  sort(v.rbegin(), v.rend());
  long long ans = 0;
  for (long long i = 0; i < n; i += k) ans += 2LL * v[i];
  cout << ans << "\n";
}
