#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, arr[2005], ans = 0;
  scanf("%d %d ", &n, &k);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &arr[i]);
  }
  sort(arr, arr + n, greater<int>());
  for (int j = 0; j < n; j += k) ans += 2 * (arr[j] - 1);
  cout << ans;
}
