两行

用分号可以一行

from math import gcd

print(int(input()) * gcd(*map(int, input().split())))