#include #include #include #include #include #include #include #include #include #include using ll = long long; using namespace std; int main() { ll n, sum1 = 0; cin >> n; vector a(2*n); for (int i = 0; i < 2 *n; i++) cin >> a[i]; sort(a.begin(), a.end()); for (int i = 0; i <= n; i++){ sum1 += a[2*i] * a[2*i+1]; } cout << sum1 << endl; }