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. List primes = sieveOfErathosthenes(1000005); long tottot = 0; //primeFactN(); //make res a LONG type int n = a.length; for(int i=0; i factors = primeFacN(x, primes); long tot = 1; long layerCnt = 1; for(int j=0; j test = new ArrayList(); test.add(1); test.add(0,2); System.out.println(test);*/ return tottot; } //returns the prime factorization of input number n static List primeFacN(long n, List primes){ List res = new ArrayList(); for(int i=primes.size()-1; i>=0; ){ long p = primes.get(i); if(n%p == 0){ res.add(p); n /= p; } else i--; } //add yea, you got to add this AT THE FRONT if(n != 1) res.add(0, n); return res; } static List sieveOfErathosthenes(int n){ //false == prime boolean[] sieve = new boolean[n+1]; for(int i=2; i<=n; i++){ if(sieve[i]) continue; for(int c=i+i; c<=n; c+=i) sieve[c] = true; } List res = new ArrayList(); for(int i=2; i<=n; i++){ if(!sieve[i]) res.add((long)i); } return res; } 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(); } }