import itertools def f(n): l = [] c = 2 a = 0 while c * c <= n: if n % c == 0: n //= c l += [c] else: c += 1 + a a = 1 if n > 1 : l += [n] return l N = int(input()) p = f(N) print(p) if len(p) > 3: tmin = N-1 a = list(itertools.product([0, 1, 2], repeat=len(p))) for i in range(len(a)): b = [1] * 3 for j in range(len(p)): b[a[i][j]] *= p[j] s = sum(b) if s < tmin : print(b) tmin = s print(tmin-3, N-1) else: print(sum(p)-len(p), N-1)