#include <bits/stdc++.h>
using namespace std;
template <class T>
T Abs(T x) {
  return x > 0 ? x : -x;
}
template <class T>
T Max(T a, T b) {
  return a > b ? a : b;
}
template <class T>
T Min(T a, T b) {
  return a < b ? a : b;
}
template <class T>
T gcd(T a, T b) {
  return (b ? gcd(b, a % b) : a);
}
bool isVowel(char ch) {
  ch = tolower(ch);
  return (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u');
}
int main() {
  int i, j, k, n, tc;
  while (cin >> n >> k) {
    vector<int> v(n);
    for (int i = (0); i < (n); i++) cin >> v[i];
    sort((v).begin(), (v).end());
    reverse((v).begin(), (v).end());
    int ans = 0;
    for (i = 0; i < n; i += k) ans += ((v[i] - 1) * 2);
    cout << ans << endl;
  }
  return 0;
}
