#!/bin/python3 import sys def pathFinder(a,path): if a == 1: return path[::-1] else: for i in range(2,a+1): if a%i == 0: path.append(i) break return pathFinder(a//i,path) def longestSequence(a,path,blocks): # Return the length of the longest possible sequence of moves. if len(path) == 0: return 0 else: return blocks + longestSequence(a//path[0],path[1:],blocks*path[0]) if __name__ == "__main__": n = int(input().strip()) a = list(map(int, input().strip().split(' '))) result = 0 for i in range(n): path = [1] path = pathFinder(a[i],path) result += longestSequence(a[i],path,1) print(result)