#!/bin/python3 import math import sys def factorSum(n): bound = math.floor(math.sqrt(n)) + 1 factor = 1 for i in range(2, bound + 1): if n % i == 0: factor = i break if factor == 1: return 1 else: return n//factor + factorSum(n//factor) def longestSequence(a): total = 0 for choc_stick in a: total += choc_stick + factorSum(choc_stick) if choc_stick != 1 else 1 return total if __name__ == "__main__": n = int(input().strip()) a = list(map(int, input().strip().split(' '))) result = longestSequence(a) print(result)