package main import "fmt" func main() { var N int fmt.Scanf("%d", &N) mn := N for i := 1; i * i * i <= N; i++ { if N % i != 0 { continue } for j := 1; j * j * i <= N; j++ { if N % (i * j) != 0 { continue } k := N / (i * j) mn = min(mn, max(0, i + j + k - 3)) } } fmt.Println(mn, N - 1) } func min(a int, b int) int { if a < b { return a } return b } func max(a int, b int) int { if a < b { return b } return a }