program W implicit none integer::N,v integer,allocatable,dimension(:)::A read*,N allocate(A(N)) read*,A read*,v print"(I0)",sum(A)-v end program W