input() # コンテストあるかどうか聞いたのにゲーセンいて飲酒してたらコンテスト終わってました、本当にごめんなさい print(sum([int(i) for i in input().split()]) - int(input()))