package main import ( "bufio" "os" "strconv" "fmt" ) func main() { X := nextInt() ans := 0 if X < 9 { if X == 4 || X % 2 == 1 { fmt.Println(X) }else { fmt.Println(X / 2) } }else { for i := 3; i * i <= X; i++ { if X % i == 0 { ans = i break } } if ans > 0 { fmt.Println(ans) }else { fmt.Println(X) } } } var s = bufio.NewScanner(os.Stdin) func next() string { s.Split(bufio.ScanWords) s.Scan() return s.Text() } func nextLine() string { s.Split(bufio.ScanLines) s.Scan() return s.Text() } func nextInt() int { i, e := strconv.Atoi(next()) if e != nil { panic(e) } return i } func nextLong() int64 { i, e := strconv.ParseInt(next(), 10, 64) if e != nil { panic(e) } return i } 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 }