#!/bin/python import sys def longestSequence(a): # Return the length of the longest possible sequence of moves. s=0 for b in a: p=0 i=2 while i<=b: if b%i==0: p+=b b/=i else: i+=1 s+=(p+1) return s if __name__ == "__main__": n = int(raw_input().strip()) a = map(long, raw_input().strip().split(' ')) result = longestSequence(a) print result