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