import sys
import os

_  = raw_input()
ex = sum(map(int, raw_input().strip().split(" ") ))
yuki = int(raw_input())
print ex - yuki