import scala.io.StdIn

object Main {
  def main(args: Array[String]): Unit = {
    val n = StdIn.readLine.toInt
    val ns = StdIn.readLine.split(' ').map(_.toInt)
    val sorted = ns.sortBy(identity)
    println(sorted.zipWithIndex.filter { case (v, i) => i % 2 == 0 }.map(_._1)sum)
  }
}