#include <bits/stdc++.h>
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  std::vector<int> people(n, 0);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &people[i]);
  }
  std::sort(people.begin(), people.end());
  std::reverse(people.begin(), people.end());
  int total = 0;
  for (unsigned int i = 0; i < people.size(); i += k) {
    int it = i >= n ? n : i;
    total += 2 * (people[it] - 1);
  }
  printf("%d\n", total);
}
