import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static boolean prime(long n) { // Corner cases if (n <= 1) return false; if (n <= 3) return true; // This is checked so that we can skip // middle five numbers in below loop if (n%2 == 0 || n%3 == 0) return false; for (int i=5; i*i<=n; i=i+6) if (n%i == 0 || n%(i+2) == 0) return false; return true; } static long divisor(long x) { long div=1,temp=(long)Math.sqrt(x); for (long i=3;i<=temp;i=i+2) { if (x%i==0) { div=x/i; break; } } return div; } static long longestSequence(long[] a) { // Return the length of the longest possible sequence of moves. long moves=0; for (int i=0;i>1; else temp=divisor(temp); } //moves=moves+sum; } } return moves; } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); long[] a = new long[n]; for(int a_i = 0; a_i < n; a_i++){ a[a_i] = in.nextLong(); } long result = longestSequence(a); System.out.println(result); in.close(); } }