import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long longestSequence(long[] a) { // Return the length of the longest possible sequence of moves. return 0; } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); long[] a = new long[n]; long ans = 0; for(int a_i = 0; a_i < n; a_i++){ a[a_i] = in.nextLong(); List factors = new ArrayList<>(); long k = 1; factors.add((Long)k); long p = 2; long z = a[a_i]; while (z > 1 && p <= Math.sqrt(z)) { if(z % p == 0) { z /= p; factors.add((Long)p); } else { p++; } } if(z > 1) { factors.add(z); } /* Collections.sort(factors, new Comparator() { @Override public int compare(Long a, Long b) { if(b > a) { return 1; } else { return -1; } } });*/ //System.out.println(factors); if(factors.size() == 1) { ans++; continue; } else if(factors.size() == 2) { ans += (1 + a[a_i]); continue; } long tally = 1; for(int i = 0 ; i < factors.size() - 1 ; i++) { tally *= factors.get(i); ans += (a[a_i] / tally); } ans++; } //long result = longestSequence(a); System.out.println(ans); in.close(); } }