import math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm_list(a):
    return reduce(lcm_base, a)

N = int(input())
a = list(map(int, input().split()))
ans = 0
num = lcm_list(a) - 1
print(num)
for i in range(len(a)):
	ans += num % a[i]
print(ans)