#!/usr/bin/env python3
import fractions
from functools import reduce


def main():
    N = int(input().strip())
    A = [int(x) for x in input().strip().split()]
    lcm = lcm_list(A) - 1
    print(lcm)
    print(f(lcm, A))
#


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


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


def f(m, A):
    result = 0
    for i in A:
        result += m % i
    return result


if __name__ == '__main__':
    main()
