#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); int n; cin>>n; vector A(2*n); rep(i,2*n) cin>>A[i]; sort(ALL(A)); ll ans=0; rep(i,n) ans+=A[2*i]*A[2*i+1]; cout<