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