#include int main(){ int n, k; std::cin >> n >> k; long long sum = 0; std::vector a(n); for (auto &x : a){ std::cin >> x; sum += x; if (x > k){ x = -(x % 2); } } std::ranges::sort(a, std::greater{}); long long diff = 0; for (int p = 1; auto &x : a){ diff += p * x; p *= -1; } std::cout << (sum + diff) / 2 << std::endl; }