#include using namespace std; int main() { int N; int64_t sum = 0; cin >> N; vector A(N * 2); for (int &a : A) cin >> a; sort(A.begin(), A.end()); for (int i = 0; i < N * 2 - 1; i += 2) sum += (int64_t)A.at(i) * A.at(i + 1); cout << sum << endl; }