#!/bin/python3 import sys def dv(a): for i in range(a // 2 + (1 if (a // 2) % 2 == 0 else 0), 2, -2): if a % i == 0: return i return 2 if a % 2 == 0 else a def lgs(a): re = 1 b = a while a > 1: print(dv(a), file=sys.stderr) a //= dv(a) re += b // a return re def longestSequence(a): # Return the length of the longest possible sequence of moves. re = 0 for b in a: re += lgs(b) return re if __name__ == "__main__": n = int(input().strip()) a = list(map(int, input().strip().split(' '))) result = longestSequence(a) print(result)