# 曲线行驶
# 车压道路边缘线,扣100分,考试结束,成绩不合格。请不要下车,等待补考
from functools import reduce
from math import gcd
n=int(
    input(

    )
)
print(
    n*reduce(
        gcd,map(
            int,
            input(

            )
            .split(

            )
        )
    )
)