#!/bin/python import sys,math array=[2,3,5,7,11,13,17,19,23,29,31,37,41] def calciforone(one): if one==1: return 1 else: j=0 while one%array[j]!=0: j+=1 sun=one return sun+calciforone(one/array[j]) def longestSequence(a,n): ser=0 for i in range(n): if a[i]==1: ser+=1 else: ser+=calciforone(a[i]) return ser # 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,n) print result