import * as fs from "fs" const main = (args: string): void => { const input = args.trim().split("\n"); const N = parseInt(input.shift()) const A = input.shift().split(" ").map(x => Number(x)) A.sort((x, y) => x > y ? -1 : 1) let ans = BigInt(0) for (let i = 0; i < 2 * N; i += 2) { ans += BigInt(A[i] * A[i + 1]) } console.log(String(ans)) } main(fs.readFileSync('/dev/stdin', 'utf8')); function apply(value: T, func: (arg: T) => R): R { return func(value) }