class B {
    static func solve() {
        let NK = readLine()!.split(separator: " ")
        let N = Int(NK[0])!
        let ps = readLine()!.split(separator: " ").map { Int($0)! }.sorted()
        var ans = 0
        for i in 0..<N {
            ans += ps[i]
        }

        print(ans)
    }
}

B.solve()
