input = raw_input range = xrange N = int(input()) record = N - 1 max_a = int(N**(1.0/3.0)) + 2 for a in range(max_a, 0, -1): if N % a: continue bc = N // a max_b = int(bc ** 0.5) + 1 if max_b * 2 + a - 6 > record: break for b in range(max_b, 0, -1): if bc % b: continue c = bc // b score = a + b + c - 3 if score < record: record = score print('{} {}'.format(record, N - 1))