#!/bin/python3 import sys from math import sqrt def factors(n): j = 3 while n > 1: while n&1==0: yield n n//=2 for i in range(j, int(sqrt(n+0.05)) + 1, 2): if n % i == 0: j = i yield n n //= i break else: if n > 1: yield n break def longestSequence(a): moves=0 for stick in a: moves+=1 for factor in factors(stick): moves+=factor return moves if __name__ == "__main__": n = int(input().strip()) a = list(map(int, input().strip().split(' '))) result = longestSequence(a) print(result)