import scala.io.StdIn._

object Main {
  def main(args: Array[String]) {
    readLine()
    val inputs:Array[String] = readLine().split(" ")
    val a: Int = inputs.map(_.toInt).sorted.zipWithIndex.filter(_._2 % 2 == 0).map(_._1).sum
    printf(s"%d\n", a)
  }
}