import math def fnx(n): if n==1: return(-1) for i in range(2,int(math.sqrt(n))+1): if n%i==0: return (i) return(1) tc=int(raw_input()) a=[int(i) for i in raw_input().split(' ')] s=0 for qw in range(tc): n=a[qw] p=n while(True): r=fnx(n) if r==1: p+=1 break elif r==-1: break else: g=n//r n=g p+=g s+=p #print(p) print(s)