#include <bits/stdc++.h>
using namespace std;
int a[2501], n, k, i, ans;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k;
  for (i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + 1 + n);
  reverse(a + 1, a + 1 + n);
  for (i = 1; i <= n; i += k) ans += (a[i] - 1) * 2;
  cout << ans << '\n';
  return 0;
}
