package main import "fmt" func main() { var n uint64 fmt.Scan(&n) ans := n if n%2 == 0 { ans = n / 2 } for i := uint64(3); i*i <= n+1; i++ { if n%i == 0 { ans = i break } } fmt.Println(ans) }