#include <bits/stdc++.h>
using namespace std;
int main() {
  priority_queue<int> a;
  int n, k;
  scanf("%d%d", &n, &k);
  int num;
  for (int i = 0; i < n; i++) {
    scanf("%d", &num);
    a.push(num);
  }
  long long ans = 0;
  while (a.size() >= k) {
    ans += (a.top() - 1) * 2;
    for (int i = 0; i < k; i++) {
      a.pop();
    }
  }
  if (a.size()) {
    ans += (a.top() - 1) * 2;
  }
  printf("%lld\n", ans);
  return (0);
}
