program main integer::N,V integer,allocatable::A(:) read *,N allocate(A(N)) read *,A read *,v print '(i0)',SUM(A)-V end program main