fun main(args: Array<String>) {
    readLine()
    readLine()?.run {
        split(" ")
            .map(String::toLong)
            .sorted()
            .filterIndexed { index, l -> index % 2 == 0 }
            .sum()
            .run(::println)
    }
}