object Main extends App {
    val Array(n, l) = io.StdIn.readLine.split(" ").map(_.toInt)
    val ss = for (_ <- 1 to n) yield io.StdIn.readLine

    val result = ss.sorted.reduce(_ + _)
    println(result)
}