#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return (!a ? b : gcd(b % a, a)); }
int lcm(int a, int b) { return (a * (b / gcd(a, b))); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k, a[2010], t = 0;
  cin >> n >> k;
  for (int i = 0; i < n; ++i) cin >> a[i];
  sort(a, a + n);
  for (int i = n - 1; i >= 0; i -= k) t += a[i] - 1;
  cout << 2 * t;
  return 0;
}
