#include <bits/stdc++.h>
using namespace std;
inline int _Int() {
  char Syed_Zafrul_Lipu[1000];
  scanf("%s", Syed_Zafrul_Lipu);
  return atoi(Syed_Zafrul_Lipu);
}
const int M = 1234567;
vector<int> v;
bool comp(int x, int y) { return x > y; }
int main() {
  int n = _Int();
  int k = _Int();
  for (int i = 0; i < n; i++) v.push_back(_Int());
  sort(v.begin(), v.end(), comp);
  for (int i = 0; i < n; i++) {
    if (v[i] != -1)
      for (int j = i + 1, cnt = 0; ((j < n) && (cnt < k)); j++) {
        if (cnt == k - 1) break;
        if (v[j] != -1) {
          v[j] = -1;
          cnt++;
        }
      }
  }
  long long int ans = 0;
  for (int i = 0; i < n; i++)
    if (v[i] != -1) ans = ans + ((v[i] - 1) << 1);
  cout << ans << endl;
}
