#include <bits/stdc++.h>
using namespace std;
int n, k, res, a[2010];
int main() {
  scanf("%d %d", &n, &k);
  for (int i = (1), _b = (n); i <= _b; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  a[0] = 1;
  res = 2 * (a[n % k] - 1);
  for (int i = n % k + 1; i <= n; i += k) res += 2 * (a[i + k - 1] - 1);
  cout << res;
}
