using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static long longestSequence(long[] a, int chocolate) { // Return the length of the longest possible sequence of moves. long N, moves, sum_moves = 0; for (int idx = 0; idx < chocolate; idx++) { N = a[idx]; moves = N; if (N > 1) { do { for (int i = 2; i <= N; i++) { if (N % i == 0) { moves += N / i; N = N / i; break; } } } while (N > 1); } sum_moves += moves; } return sum_moves; } 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); } }