import java.util.Scanner; public class TGMain { public static void main(String[] args){ int a, b, c; int v; int ans = 0; Scanner sc = new Scanner(System.in); int[] all = new int[sc.nextInt()]; for(int i = 0; i < all.length; i++){ ans += sc.nextInt(); } v = sc.nextInt(); System.out.println(v - ans); } }