import java.io.*; import java.math.*; import java.util.*; public class Main { static int[] vy = {1,0,-1,0}; static int[] vx = {0,1,0,-1}; public static void main(String[] args) { Scanner sc = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); int N = sc.nextInt(); int[] A = new int[N]; for(int i = 0; i < N; i++) { A[i] = sc.nextInt(); } int v = sc.nextInt(); int sum = 0; for(int i = 0; i < N; i++) { sum += A[i]; } System.out.println((sum - v)); } }