#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, e, i, a, c = -1, flo = 0, flot = 0;
  vector<int> vec;
  vector<int> vec2;
  cin >> n >> e;
  for (i = 0; i < n; i++) {
    cin >> a;
    a -= 1;
    vec.push_back(a);
  }
  sort(vec.begin(), vec.end());
  reverse(vec.begin(), vec.end());
  flo = 0;
  flot = 0;
  while (1) {
    flo = 0;
    if (vec.size() == 0 && vec2.size() == 0) {
      break;
    } else if (vec.size() == 0 && vec2.size() != 0) {
      e = vec2.size();
    }
    if (vec2.size() < e) {
      vec2.push_back(vec[0]);
      vec.erase(vec.begin());
      c++;
    } else {
      flo = vec2[0] * 2;
      flot += flo;
      flo = 0;
      vec2.erase(vec2.begin(), vec2.begin() + vec2.size());
    }
  }
  cout << flot;
  return 0;
}
