from fractions import gcd from math import factorial, ceil, sqrt, atan2 from itertools import * import string import copy import random from decimal import * def id_generator(size=20, chars=string.digits): return ''.join(random.choice(chars) for _ in range(size)) def mp(): return map(int,str(raw_input()).split()) primes=[] sieve=[1 for i in range(10**6+1)] sieve[0]=0 sieve[1]=0 for i in range(2,10**6+1): if sieve[i]==1: for j in range(i*i,10**6+1,i): sieve[j]=0 for i in range(10**6+1): if sieve[i]: primes+=[i] #primes=primes[::-1] n=input() l=list(mp()) ans=0 for i in range(n): a=l[i] ans+=1 count=1 z=[] while a>0: flag=0 for j in primes: if a%j==0: #print j,a a/=j flag=1 z+=[j] break if a==1: break if flag==0: z+=[a] break z.reverse() for i in z: count*=i ans+=count print ans