#!/bin/python3 import sys def largestprime(n): i = 2 while n > 1: if n % i == 0: n = n // i else: i = i + 1 return i def longestSequence(a): # Return the length of the longest possible sequence of moves. moves = len(a) for i in a: sticks = 1 offspring = i while offspring > 1: largest = largestprime(offspring) offspring //= largest moves += largest * sticks sticks *= largest return moves if __name__ == "__main__": n = int(input().strip()) a = list(map(int, input().strip().split(' '))) result = longestSequence(a) print(result)