#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:36777216")
long long EPS = 1000000007;
double PI = 3.14159265358979323846;
const int MAXN = 1000010;
long long abss(long long h) {
  if (h < 0) {
    return -h;
  }
  return h;
}
double fabss(double h) {
  if (h < 0.0) {
    return -h;
  }
  return h;
}
long long ceill(long long x, long long y) {
  if (x % y != 0) {
    return (x / y) + 1;
  }
  return x / y;
}
int n, m, k;
long long a[MAXN];
int b[MAXN];
int c[MAXN];
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  reverse(a, a + n);
  int i = 0;
  long long ans = 0;
  int prevI = i;
  for (i = 0; i < n; i += k) {
    if (i >= n) {
      if (prevI == n - 1) {
        break;
      }
      ans += (a[prevI + 1] - 1) * 2;
      break;
    }
    ans += (a[i] - 1) * 2;
    prevI = i;
  }
  cout << ans;
}
