import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

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

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N = input()
N = int(N)
a=list(map(int,input().split()))
m = lcm(*a)
print(m)
x = 0
for j in range(N):
  x += (m-1) % a[j]
print(x)


