#!/bin/python3 import math import sys from collections import defaultdict # sieve of Eratosthenes def primes_upto(n): if n <= 1: return [] A = defaultdict(lambda: True) A[0] = False A[1] = False root_n = int(math.sqrt(n)) for i in range(2, root_n + 1): i_squared = i * i if A[i]: for j in range(i_squared, n + 1, i): A[j] = False return (i for i in range(n + 1) if A[i]) # cache of prime numbers up to sqrt(10**12) primes = list(primes_upto(10 ** 6)) def prime_factors(n): if n < 2: return [] i = 0 while i < len(primes): p = primes[i] if n == p: break if n % p == 0: yield p n //= p else: i += 1 yield n def optimal_breaks(n): total = 1 for f in prime_factors(n): total = total*f + 1 return total def longest_sequence(a): return sum(optimal_breaks(b) for b in a) if __name__ == "__main__": n = int(input().strip()) a = list(map(int, input().strip().split(' '))) result = longest_sequence(a) print(result)