#include <bits/stdc++.h>
using namespace std;
int wantFloor[2222];
int onFloor[2222];
int main() {
  ios::sync_with_stdio(0);
  fill(wantFloor, wantFloor + 2222, 0);
  fill(onFloor, onFloor + 2222, 0);
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    ++wantFloor[x - 1];
  }
  long long ans = 0;
  onFloor[0] = n;
  for (int i = 0; i <= 2010; ++i) {
    while (onFloor[i]) {
      ans += 2;
      onFloor[i + 1] += min(onFloor[i], k);
      onFloor[i] -= min(onFloor[i], k);
    }
    onFloor[i + 1] -= wantFloor[i + 1];
  }
  cout << ans << endl;
}
