#!/bin/python import sys seq = [-1]*1000001 def longestSequence(a): # Return the length of the longest possible sequence of moves. Sum = 0 for e in a: Sum+=getValue(e) return Sum def prime_factors(n): """Returns all the prime factors of a positive integer""" factors = [] d = 2 while n > 1: while n % d == 0: factors.append(d) n /= d d = d + 1 if d*d > n: if n > 1: factors.append(n) break return factors def getValue(n): if n==1: return 1 x = max( prime_factors(n)) num = int(n)/x return 1+(x)*getValue(num) if __name__ == "__main__": n = int(raw_input().strip()) a = map(long, raw_input().strip().split(' ')) seq[1]=1 seq[0]=0 result = longestSequence(a) print result