(println
  (reduce + (let [v   (->> (clojure.string/split (read-line) #"\s")
                           (map #(Integer/parseInt %))
                           (sort)
                           (reverse))
                  dup (conj (rest v) (last v))]
              (map (fn [i j] (- i j)) v dup))))