n, x = map(int, input().split()) s = list(map(int, input().split())) s.sort() S = sum(s) print(S - x * (n - 1))