var i,k,j,s:integer;
begin
readln(k);
FOR I:=100 TO 300 DO
s:=0;
for j:=1 to i do
if i mod j=0 then s:=s+j;
if s=k then writeln(i);
end;
end.
var i,k,j,s:integer;
begin
readln(k);
FOR I:=100 TO 300 DO
begin
s:=0;
for j:=1 to i do
if i mod j=0 then s:=s+j;
if s=k then writeln(i);
end;
end.