import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long biggestMultiplier(long a){ int i; for(i=2; i< a+1 ; i++){ if( (a%i) == 0){ return (a/i); } } return a; } static long longest(long a) { long sum=0; while(true){ if(a!=1) sum+=a; a = biggestMultiplier(a); if(a == 1){ sum+=1; break; } } return sum; } static long longestSequence(long[] a , int n) { int i; long sum=0; for(i=0;i