import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(), s = 0, r; for(int i = 0; i < n; i++){ s += sc.nextInt(); } r = sc.nextInt(); System.out.println(s-r); } }