import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static HashMap hm = new HashMap<>(); //hm.put(2,3); static long calc(long x) { if(x == 1) return 1l; long result = x+1; for(int i = 2 ; i<=Math.sqrt(x) ; i++) { if(x%i == 0) { long t = 0; if(hm.containsKey(i)) t = hm.get(i); else t = calc(i); result = Math.max(result,1+t*(x/i)); if(hm.containsKey(x/i)) t = hm.get(x/i); else t = calc(x/i); result = Math.max(result,1+t*i); } } hm.put(x,result); return result; } static long longestSequence(long[] a) { long result = 0; for(int i = 0 ; i