object Main extends App {
	val Array(n, x) = scala.io.StdIn.readLine.split(" ").map(_.toLong)
	val a = scala.io.StdIn.readLine.split(" ").map(_.toLong)

	if(a.max < x){
		println(a.sum)
	}else{
		println(n*a.min + x*(n-1))
	}
	

}

