eval(input());print((eval(input().replace(' ','-1+'))-1))
n,a=open(0);print((sum(map(int,a.split()))-int(n)))
eval(input())
print((eval(input().replace(" ", "-1+")) - 1))

n, a = open(0)
print((sum(map(int, a.split())) - int(n)))

-eval(input()) -print((eval(input().replace(" ", "-1+")) - 1)) +n, a = open(0) +print((sum(map(int, a.split())) - int(n)))