#include <bits/stdc++.h>
using namespace std;
int main() {
  int num, capacity, i, a[2001];
  scanf("%d %d", &num, &capacity);
  for (i = 1; i <= num; i++) scanf("%d", &a[i]);
  a[0] = 1;
  sort(a + 1, a + num + 1);
  int time = 0, x = num, count;
  for (i = 1; i <= num; i++) {
    count = (x / capacity);
    if (x % capacity != 0) count++;
    time = time + (a[i] - a[i - 1]) * (2 * count - 1);
    x--;
  }
  time = time + a[num] - 1;
  printf("%d\n", time);
  return 0;
}
