import java.util.Scanner; class Difference{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); int num = scan.nextInt(); int sum = 0; for(int i = 0; i < num; i++){ sum += scan.nextInt(); } int yuki = scan.nextInt(); int sa = sum - yuki; System.out.println(sa); } }