#!/bin/python3 import sys def hypersum(k): if k==1: return 1 else: l=[] i=2 while k%i!=0: i+=1 return k+hypersum(k//i) def longestSequence(a): s=0 for i in a: s+=hypersum(i) return s # 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)