#!/bin/python3 import sys def facts(n): l = [] f = 2 while f*f <= n: if not n%f: n //= f l.append(f) else: f+=1 if not n == 1: l.append(n) return reversed(l) def longestSequence(a): n = 0 for l in map(facts, a): c = 1 for f in l: n += c c *= f n += c return n # Return the length of the longest possible sequence of moves. if __name__ == "__main__": n = int(input().strip()) a = list(map(int, input().strip().split(' '))) result = longestSequence(a) print(result)