#include using namespace std; const int N = 105; int n, k, a[N]; long long ans; struct node { int hs, cst, ts; bool operator<(const node &_x) { return cst > _x.cst; } } b[N]; int main() { cin >> n >> k; for (int i = 1; i <= n; i++) { scanf("%d", a + i); int v; if (a[i] <= k) v = a[i]; else v = a[i] / 2; b[i].hs = v, b[i].ts = a[i] - v; b[i].cst = b[i].hs - b[i].ts; } sort(b + 1, b + n + 1); for (int i = 1; i <= n; i++) if (i & 1) ans += b[i].hs; else ans += b[i].ts; cout << ans << endl; return 0; }