object Main{
  def main(args:Array[String]):Unit={
    var N = readInt
    var lengths = readLine.split(" ").map(x => x.toInt)
    var lengthsBySorted = lengths.sorted

    var res = 0
    for(i <- 0 until N){
      res+=scala.math.min(lengthsBySorted(2*i),lengthsBySorted(2*i+1))
    }

    println(res)
  }
}