#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  int store[20001];
  int last = 0;
  memset(store, 0, sizeof(store));
  for (int i = 0; i < n; i++) {
    int next;
    scanf("%d", &next);
    store[next]++;
    last = max(last, next);
  }
  int ans = 0;
  for (int i = 2; i <= 2000; i++) {
    int add = 2 * ceil(((double)n) / k) - 1;
    add = max(add, 0);
    ans += add;
    n -= store[i];
  }
  printf("%d", ans + last - 1);
  return 0;
}
