import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long getGreatestPrimeDivisor(long a){ long aHalf = a/2; long div = 0; for(long i=2; i<=aHalf && div==0; i++){ if(a%i == 0){ div = i; } } if(div==0){ return (a); } else { return getGreatestPrimeDivisor(a/div); } } static long mostMoves(long a){ if (a == 1){ return(1); } else { long div = getGreatestPrimeDivisor(a); long newStick = a/div; return(1 + (div * mostMoves(newStick))); } } static long longestSequence(long[] a) { // Return the length of the longest possible sequence of moves. long result = 0; for(int i=0; i