n = int(input()) Tmax = n - 1 Tmin = 0 for i in [3,2]: for j in range(int(pow(n, 1/i)), 0, -1): if n % j == 0: Tmin += j - 1 n /= j break Tmin += n - 1 print(int(Tmin), Tmax)