# ans



N = int(eval(input()))

a = list(map(int, input().split()))



ans = 0



for i in range(N):

  ans += a[i] - 1

  

print(ans)
N = int(eval(input()))

a = list(map(int, input().split()))

print((sum(a) - N))
# ans
N = int(eval(input()))
a = list(map(int, input().split()))
ans = 0
for i in range(N):
    ans += a[i] - 1
print(ans)

N = int(eval(input()))
a = list(map(int, input().split()))
print((sum(a) - N))

-# ans -ans = 0 -for i in range(N): -    ans += a[i] - 1 -print(ans) +print((sum(a) - N))