N = int(input()) maxAns = N - 1 n = N div = 0 while n % 2 == 0: n //= 2 div += 1 minAns = n - 1 + div print(minAns,maxAns)