def main(): N = input() A = map(int, input().split()) yuki = int(input()) print(sum(A)-yuki) if __name__ == '__main__': main()