#coding: utf-8



N = eval(input())

A = [int(x) for x in input().split()]



print((sum(x-1 for x in A)))

N = eval(input())

print((sum(int(x)-1 for x in input().split())))

# coding: utf-8
N = eval(input())
A = [int(x) for x in input().split()]
print((sum(x - 1 for x in A)))

N = eval(input())
print((sum(int(x) - 1 for x in input().split())))

-# coding: utf-8 -A = [int(x) for x in input().split()] -print((sum(x - 1 for x in A))) +print((sum(int(x) - 1 for x in input().split())))