#!/bin/python import sys memo = {} def factorization(value): da_value = value factors = [] while value % 2 == 0: factors.append(2) value = value >> 1 for a in range(3,int(pow(value,0.5))+1,2): while value % a == 0: factors.append(a) value = value / a if value > 2: factors.append(value) return factors def division(value): factors = factorization(value)[::-1] val = 1 suma = 0 for each in factors: val = val*each suma += val suma += 1 return suma def longestSequence(a): vals = 0 for each in a: vals += division(each) return vals # Return the length of the longest possible sequence of moves. if __name__ == "__main__": n = int(raw_input().strip()) a = map(long, raw_input().strip().split(' ')) result = longestSequence(a) print result