package main import ( "fmt" "io" "os" ) func solve(in io.Reader, out, err io.Writer) { var n int fmt.Fscan(in, &n) if n <= 104 { fmt.Fprintln(out, 4) } else { if (n/2)*2 == n { fmt.Fprintln(out, n) } else { fmt.Fprintln(out, n+1) } } } func main() { solve(os.Stdin, os.Stdout, os.Stderr) }