extension String: CollectionType {}

let line1 = readLine()!
var line2 = readLine()!

var N = Int(line1)!
let L = line2.split(" ").map{ Int($0)! }

let sorted = L.sort({ (first, second) -> Bool in
    return first < second                     
})
var sum = 0
var i = 0
while i < sorted.count {
  sum += min(sorted[i], sorted[i + 1])
  i += 2
}
print(sum)