#!/bin/python import sys def primeFactors(n): ret = [] while n % 2 == 0: ret.append(2) n = n / 2 for i in range(3,int((n)**0.5)+1,2): while n % i== 0: ret.append(i) n = n / i if n > 2: ret.append(n) return ret[::-1] def individual(n): if n==1: return 1 if n==2: return 3 factors = primeFactors(n) ret = 1 product = 1 for i in factors: product *= i ret += product return ret def longestSequence(a): ret = 0 for i in a: ret += individual(i) return ret # 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