import java.util.Scanner; public class Solution{ public static void main(String[] args) { // TODO Auto-generated method stub Scanner s = new Scanner(System.in); int no = s.nextInt(); int ans = 0; for(int i=0; i maxvalue){ maxvalue = tempmaxvalue; } } if(size == 1){ maxvalue = 1; }else if(maxvalue == 0){ maxvalue = size+1; } ans = ans + maxvalue; } System.out.println(ans); } private static int maxvalue(int balance,int divisor,int product,int sum,int fullsize){//limit = size/2 prevprod = 1 int maxval = 0; if(balance == 1){ return sum; } if(divisor == 1){ return sum+fullsize; }else if(balance % divisor == 0){ balance = balance /divisor; product = product * divisor; sum = sum + product; int tempmaxvalue = maxvalue(balance,divisor,product,sum,fullsize); if(tempmaxvalue > maxval){ maxval = tempmaxvalue; } //return maxval; }else{ divisor--; int tempmaxvalue = maxvalue(balance,divisor,product,sum,fullsize); if(tempmaxvalue > maxval){ maxval = tempmaxvalue; } } return maxval; } }