(ns atcoder.agc001-a
  (:require [clojure.string :as str]))

(defn int-line []
  (map #(Integer/parseInt %) (str/split (read-line) #" ")))

(let [[n] (int-line)
      skewers (int-line)]
  (let [combi (partition 2 (sort skewers))]
    (reduce + (map first combi))))