#!/bin/python import sys import math def longestSequence(a): # Return the length of the longest possible sequence of moves. total_moves = 0 for stick in a: factors = prime_factors(stick) prev = 1 total_moves +=1 for factor in factors[::-1]: prev = factor * prev total_moves += prev return total_moves factor_dict = {} def prime_factors(n): factors=[] while n % 2 == 0: factors.append(2) n = n / 2 for i in range(3,int(math.sqrt(n))+1,2): while n % i== 0: factors.append(i), n = n / i if n > 2: factors.append(n) return factors if __name__ == "__main__": n = int(raw_input().strip()) a = map(long, raw_input().strip().split(' ')) result = longestSequence(a) print result