begin
var n := ReadlnString.ToBigInteger;
var Count := BigInteger(0);
var Max := Biginteger(n);
while n <> 1 do
begin
if n.IsEven then
begin
n := n div 2;
Count += n
end
else
begin
n += 2 * n + 1;
if Max < n then
Max := n
end
end;
Print(Count, Max);
end.