#include <bits/stdc++.h>
using namespace std;
int a[100010];
int main() {
  ios::sync_with_stdio(0);
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; ++i) cin >> a[i];
  int ans = 0;
  for (int h = 2; h <= 2000; ++h) {
    int cnt = 0;
    for (int i = 0; i < n; ++i) cnt += (a[i] >= h);
    ans += 2 * ((cnt + k - 1) / k);
  }
  cout << ans << "\n";
  return 0;
}
