import java.util.*
object MainKt {
  @JvmStatic fun main(args:Array<String>) {
    val sc = Scanner(System.`in`)
    val N = 2*sc.nextInt()
    var Larray: Array<Int> = Array(N, { sc.nextInt()})
    var LList:MutableList<Int> = mutableListOf()
    Larray.sort()
    for (l in Larray)
    {
      LList.add(l)
    }
    var sum:Int=0
    while (!LList.isEmpty())
    {
      val k = LList.take(2)
      sum+=LList.take(2).min()!!
      for (i in k)
      {
       LList.remove(i)
      }
    }
    println(sum)
  }
}
