#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  vector<int> floors;
  for (int i = 0; i < n; ++i) {
    int tmp;
    scanf("%d", &tmp);
    --tmp;
    floors.push_back(tmp);
  }
  sort(floors.rbegin(), floors.rend());
  int prev_i = 0, total = 0, i;
  for (i = 0; i < n; i += k) {
    total += floors[i];
    prev_i = i;
  }
  total *= 2;
  printf("%d\n", total);
  return 0;
}
