N = int(eval(input()))

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



print((sum(As)-len(As)))

_ = eval(input())

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



print((sum(As)-len(As)))

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

_ = eval(input())
As = list(map(int, input().split()))
print((sum(As) - len(As)))

-N = int(eval(input())) +_ = eval(input())