#include <bits/stdc++.h>
using namespace std;
int to_remove_here[2002];
int main() {
  memset(to_remove_here, 0, sizeof to_remove_here);
  int n, k, in;
  long long ans = 0;
  cin >> n >> k;
  int tmp = n;
  while (n--) {
    cin >> in;
    to_remove_here[in]++;
  }
  n = tmp;
  for (int i = 2; i < 2002; i++) {
    ans += 2 * ((n + k - 1) / k);
    n -= to_remove_here[i];
  }
  cout << ans << endl;
}
