#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
int smallest(int x, int y, int z) {
  int c = 0;
  while (x && y && z) {
    x--;
    y--;
    z--;
    c++;
  }
  return c;
}
long long fast_exp(long long base, long long exp) {
  long long res = 1;
  while (exp > 0) {
    if (exp % 2 == 1) res = (res * base) % mod;
    base = (base * base) % mod;
    exp /= 2;
  }
  return res % mod;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
struct comparator {
  bool operator()(int i, int j) { return i > j; }
};
int main() {
  int n, k;
  cin >> n >> k;
  int arr[2005], i;
  for (i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
  }
  int ans = 0;
  sort(arr, arr + n);
  for (i = 0; n > 0; i++) {
    ans += arr[n - 1] - 1;
    n -= k;
  }
  cout << 2 * ans;
}
