let rec is_prime p n =
  if n < p * p
  then true
  else 0 < n mod p && is_prime (p + 1) n
let is_prime = is_prime 2

let rec solve n =
  if is_prime n then n else solve (n + 1)

let () = Printf.printf "%d" @@ Scanf.scanf "%d\n" @@ solve
