#339 how many people answer #if difference is 0 def gcd(a,b): if a>b: m=a t=b else: m=b t=a r=m%t while r!=0: m=t t=r r=m%t return t N=int(input()) A=[int(input())for i in range(N)] if N==1: a=1 else: g=gcd(A[0],A[1]) #rint (g) i=2 while i