package main import "fmt" func main() { var N int fmt.Scanf("%d", &N) mn := N for i := 1; i * i * i <= N; i++ { for j := i; i * j <= N; j++ { for k := j; i * j * k <= N; k++ { if i * j * k == N { 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 }