-- Try AtCoder
-- author: Leonardone @ NEETSDKASU

main = print . solve . map read . words =<< getContents

solve (n:x:a) = ans where
    sm = sum a
    mn = minimum a
    xx = n * mn + x * (n - 1)
    ans = minimum [sm, xx]
