#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2010;
int f[MAXN];
int main() {
  int n, k;
  while (scanf("%d%d", &n, &k) != EOF) {
    for (int i = 1; i <= n; ++i) {
      scanf("%d", &f[i]);
    }
    sort(f + 1, f + 1 + n);
    int ret = 0;
    for (int i = n; i >= 1; i -= k) {
      ret += (f[i] - 1) * 2;
    }
    printf("%d\n", ret);
  }
  return 0;
}
