#!/usr/bin/env python n = input() inval = [int(x) for x in input().split()] insum = int(input().strip()) print(sum(inval)-insum)