defmodule Main do def input, do: IO.read(:line) |> String.trim def ii, do: input() |> String.to_integer def li, do: input() |> String.split |> Enum.map(&String.to_integer/1) def yn(b), do: (if b, do: "Yes", else: "No") def factorize(n) do factorize(n, 2) end defp factorize(n, p) do cond do n == 1 -> [] p * p > n -> [n] rem(n, p) == 0 -> [p | factorize(div(n, p), p)] true -> factorize(n, p+1) end end def f(n) do fs = factorize(n) if length(fs) == 1 do n else f(n-1) end end def modpow(x, n, mod) do cond do n == 0 -> 1 rem(n, 2) == 0 -> y = modpow(x, div(n, 2), mod) rem(y * y, mod) true -> rem(x * modpow(x, n - 1, mod), mod) end end def inv(x, mod) do modpow(x, mod-2, mod) end def lcm(a, b), do: div(a * b, Integer.gcd(a, b)) @mod 998244353 def main do n = ii() p = f(n) ans = for i <- 2..n, i != p, reduce: 1 do acc -> rem(lcm(acc, i), @mod) end IO.puts ans end end