def rwh_primes(n): # https://stackoverflow.com/questions/2068372/fastest-way-to-list-all-primes-below-n-in-python/3035188#3035188 """ Returns a list of primes < n """ sieve = [True] * n for i in range(3,int(n**0.5)+1,2): if sieve[i]: sieve[i*i::2*i]=[False]*((n-i*i-1)//(2*i)+1) return [2] + [i for i in range(3,n,2) if sieve[i]] primes = rwh_primes(int(2e6)) plen = len(primes) def count(a): ans = a = int(a) if a == 1: return 1 i = 0 while a > 1: p = primes[i] if p * p > a: ans += 1 break while a % p == 0: a //= p ans += a i += 1 return ans n = int(input().strip()) print(sum(map(count, input().strip().split())))