from fractions import gcd



n = int(eval(input()))

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



res = 0

for i in array:

    res += i-1

print(res)
n = int(eval(input()))

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



res = 0

for i in array:

    res += i-1

print(res)
from fractions import gcd

n = int(eval(input()))
array = sorted([int(x) for x in input().split()])
res = 0
for i in array:
    res += i - 1
print(res)

n = int(eval(input()))
array = [int(x) for x in input().split()]
res = 0
for i in array:
    res += i - 1
print(res)

-from fractions import gcd - -array = sorted([int(x) for x in input().split()]) +array = [int(x) for x in input().split()]