#include <bits/stdc++.h>
using namespace std;
int a[2005];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  sort(a + 1, a + n + 1);
  long long sum = 0;
  for (int i = n; i >= 1; i -= k) {
    sum += abs(a[i] - 1) * 2;
  }
  printf("%lld\n", sum);
}
