#!/bin/python import sys import sys,math def prime(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/2) for i in xrange(3,int(n**0.5)+1,2): if sieve[i/2]: sieve[i*i/2::i] = [False] * ((n-i*i-1)/(2*i)+1) return [2] + [2*i+1 for i in xrange(1,n/2) if sieve[i]] def isprime(n): """Returns True if n is prime.""" if n==1: return False if n == 2: return True if n == 3: return True if n % 2 == 0: return False if n % 3 == 0: return False i = 5 w = 2 while i * i <= n: if n % i == 0: return False i += w w = 6 - w return True from math import * def longestSequence(a): # Return the length of the longest possible sequence of moves. # Return the length of the longest possible sequence of moves. count=sum(a) for i in a: if isprime(i): count+=1 elif i==1: pass else: lst= prime(i) x=1 for j in lst[::-1]: while i%j==0: count+=x x*=j i/=j return count if __name__ == "__main__": n = int(raw_input().strip()) a = map(long, raw_input().strip().split(' ')) result = longestSequence(a) print result