#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  int i, ans, j, t;
  int num[2005];
  while (scanf("%d%d", &n, &k) != EOF) {
    ans = 0;
    for (i = 0; i < n; i++) scanf("%d", &num[i]);
    for (i = 0; i < n; i++)
      for (j = 0; j < n - i - 1; j++)
        if (num[j] > num[j + 1]) {
          t = num[j];
          num[j] = num[j + 1];
          num[j + 1] = t;
        }
    for (i = n - 1; i >= 0; i = i - k) ans += (num[i] - 1) * 2;
    printf("%d\n", ans);
  }
}
