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