n,x = map(int,input().split())
s = list(map(int,input().split()))

ans = sum(s)-x*(n-1)
print(ans)