#!/bin/python3 import sys import math def primeFactors(n): res = [] while n % 2 == 0: res.append(2) n = n / 2 for i in range(3, int(math.sqrt(n))+1, 2): while n % i == 0: res.append(i) n = n / i if n > 2: res.append(n) return res def longestSequence(a): length = [] for n in a: move = 1 pieces = 1 size = n factors = primeFactors(n) factors.reverse() for f in factors: pieces *= f size /= f move += pieces length.append(move) return int(sum(length)) # Return the length of the longest possible sequence of moves. if __name__ == "__main__": n = int(input().strip()) a = list(map(int, input().strip().split(' '))) result = longestSequence(a) print(result)