object Main extends App {

  import scala.io.StdIn.{readInt, readLine}
  val n = readInt()
  val arr = readLine().trim.split(" ").map(_.toInt)
  val sorted = arr.toList.sorted
  var ans = 0
  for (i <- 0 to (sorted.length - 1)) {
    if (i % 2 == 0) ans += sorted(i)
  }
  println(ans)

}