#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n, k, i, a[2000];
  cin >> n >> k;
  for (i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  i = n - 1;
  int ans = 0;
  while (i >= 0) {
    int j = i, m = a[j];
    while (j >= 0 && j >= i - k + 1) {
      if (a[j] > m) m = a[j];
      j--;
    }
    i -= k;
    ans += (m + m - 2);
  }
  cout << ans;
  return 0;
}
