using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static long longestSequence(long[] a, int n) { long ans = 0; long moves = 1; for (int i = 0; i < n; i++){ long test = a[i]; moves = test; while (test > 1){ for (int j = 2; j <= test; j++){ if (test % j == 0){ test = test/j; moves += test; break; } } } ans += moves; } return ans; } static void Main(String[] args) { int n = Convert.ToInt32(Console.ReadLine()); string[] a_temp = Console.ReadLine().Split(' '); long[] a = Array.ConvertAll(a_temp,Int64.Parse); long result = longestSequence(a, n); Console.WriteLine(result); } }