import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long find(long n, Hashtable d){ if (d.get(n) != null) { return (long)d.get(n); } else { long res = n; long i = 2; int flag = 0; while (i<(long)(Math.sqrt(n))+1){ if (n%i==0){ res += find((long)(n/i), d); flag = 1; break; }else {i += 1;} } if (flag == 0) {res += 1;} d.put(new Long(n), new Long(res)); return res; } } static long longestSequence(long[] a, Hashtable d) { // Return the length of the longest possible sequence of moves. long s = 0; for(int i = 0; i