#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
const int maxN = 2100;
int n, k;
int a[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 res = 0;
  for (int i = 0; i < n; i += k) {
    res += 2 * (a[i] - 1);
  }
  cout << res << endl;
  return 0;
}
