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