#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int c[2020] = {};
  for (int i = 0; i < n; i++) {
    int f;
    cin >> f;
    c[f + 1]--;
    c[1]++;
  }
  for (int i = 2; i <= 2000; i++) c[i] += c[i - 1];
  int ans = 0;
  for (int i = 2; i <= 2000; i++) {
    ans += (c[i] + k - 1) / k;
  }
  ans *= 2;
  cout << ans << endl;
  return 0;
}
