#include <bits/stdc++.h>
using namespace std;
int n, k;
int f[2005];
int main(int argc, char *argv[]) {
  cin >> n >> k;
  for (int i = 0; i < n; i++) scanf("%d", &f[i]);
  sort(f, f + n);
  int ans = 0, cur = 1;
  for (int cur = 2; cur <= f[n - 1]; cur++) {
    int sum = 0;
    for (int j = 0; j < n; j++)
      if (f[j] >= cur) sum++;
    int c = (sum + k - 1) / k;
    ans += 2 * c - 1;
  }
  ans += f[n - 1] - 1;
  cout << ans << endl;
  return 0;
}
