#include <bits/stdc++.h>
using namespace std;
template <class T, class U>
inline T max(T &a, U &b) {
  return a > b ? a : b;
}
template <class T, class U>
inline T min(T &a, U &b) {
  return a < b ? a : b;
}
template <class T, class U>
inline T swap(T &a, U &b) {
  T tmp = a;
  a = b;
  b = tmp;
}
const long long INF = (1ll) << 50;
const int mx = 1e5 + 7;
const int mod = 1000000007;
const double pi = 2 * acos(0.0);
int EQ(double d) {
  if (fabs(d) < 1e-7) return 0;
  return d > 1e-7 ? 1 : -1;
}
long long arr[mx];
int main() {
  int n = ({
    int a;
    scanf("%d", &a);
    a;
  }),
      k = ({
        int a;
        scanf("%d", &a);
        a;
      });
  for (__typeof((n)-1) i = (0); i <= ((n)-1); ++i) {
    arr[i] = ({
      int a;
      scanf("%d", &a);
      a;
    });
  }
  sort(arr, arr + n);
  reverse(arr, arr + n);
  long long ans = 0;
  for (int i = 0; i < n; i += k) {
    long long Max = 0;
    for (__typeof(i + k - 1) j = (i); j <= (i + k - 1); ++j)
      Max = max(arr[i], Max);
    ans += 2 * (Max - 1);
  }
  cout << ans << endl;
}
