#!/bin/python3 import sys def sequence(x): if x == 1: return 1 divisors = [] d = 2 while( x > 1 ): while( x % d == 0 ): x = x // d divisors.append(d) d += 1 tot = 1 for d in (divisors): tot *= d tot += 1 #tot *= d return tot def longestSequence(a): # Return the length of the longest possible sequence of moves. tot = 0 for x in a: tot += sequence(x) return tot if __name__ == "__main__": n = int(input().strip()) a = list(map(int, input().strip().split(' '))) result = longestSequence(a) print(result)