#!/bin/python import sys def sieve(N): isprime = [False, False, True] + [True, False]*(N/2) for p in range(3, N+1): if isprime[p]: kp = 3*p while kp <= N: isprime[kp] = False kp += 2*p return [p for p in range(N+1) if isprime[p]] primes = sieve(200000) def process(n): if n==1: return 1 a = 1 for p in primes: if p*p > n: break count = 0 while n%p ==0: n/=p a = 1 + a*p if n>1: a = 1 + a*n return a def longestSequence(a): # Return the length of the longest possible sequence of moves. return sum(map(process, a)) if __name__ == "__main__": n = int(raw_input().strip()) a = map(long, raw_input().strip().split(' ')) result = longestSequence(a) print result