#include <bits/stdc++.h>
using namespace std;
const int MaxN = 100000;
int a[MaxN];
int color[MaxN];
bool f = true;
int n;
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  sort(a + 1, a + n + 1);
  reverse(a + 1, a + n + 1);
  while (n % k) {
    a[n + 1] = a[n];
    n++;
  }
  int ans = 0;
  for (int i = 0; i < n / k; ++i) {
    ans += (2 * (a[k * i + 1] - 1));
  }
  cout << ans;
}
