import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long longestSequence(long[] a) { long sum=0; for(int i=0;i< a.length;i++) { if(a[i]!=1) sum+=((a[i]%2==1)?(findAns(a[i],lowestPrime(a[i]))):(findAns(a[i],2))); else sum+=1; //System.out.println(a[i]); /*if(a[i]%2 == 1) System.out.println(lowestPrime(a[i]));*/ } // Return the length of the longest possible sequence of moves. return sum; } static long lowestPrime(long num) { //System.out.println("this"); long fact=3; while(true) { if(num%(fact) == 0) { //System.out.println(num+" "fact); return fact; } //return fact; fact+=2; } } static long findAns(long a,long b) { //System.out.println(a+""+b); if(a