#!/bin/python3 import sys def primes(n): primfac = [] d = 2 while d*d <= n: while (n % d) == 0: primfac.append(d) # supposing you want multiple factors repeated n //= d d += 1 if n > 1: primfac.append(n) return primfac def longestSequence(a): # Return the length of the longest possible sequence of moves. move = 0 flag = 0 for i in a : if i==1: move += 1 else : lis = primes(i) # print(lis) fac = 1 for i in range(1,len(lis)+1): fac = fac * lis[-i] #print(fac) move += fac move +=1 return move if __name__ == "__main__": n = int(input().strip()) a = list(map(int, input().strip().split(' '))) result = longestSequence(a) print(result)