#!/bin/python import sys import math # list is sorted def getPrimeFactors(n): result = [] # get all prime factors starting with the smallest prime while n % 2 == 0: result.append(2) n /= 2 for i in xrange(3, int(math.sqrt(n)) + 1, 2): while n % i == 0: result.append(i) n /= i # add remaining factor if n > 2: result.append(n) return result def breakSticks(factors, cache): # if n is a prime number # break this piece into a single piece (1 move) # eat all of it (n moves) result = 1 + factors[0] # build solution for i in xrange(1, len(factors)): result = 1 + (result * factors[i]) return result def longestSequence(a): # Return the length of the longest possible sequence of moves. result = 0 cache = {} for num in a: if num == 1: result += 1 continue # get all prime divisors factors = getPrimeFactors(num) result += breakSticks(factors, cache) return result if __name__ == "__main__": n = int(raw_input().strip()) a = map(long, raw_input().strip().split(' ')) result = longestSequence(a) print result