defmodule Main do def main do IO.read(:line) IO.read(:line) |> String.trim() |> String.split() |> solve |> IO.puts() end def solve(a) do a |> Enum.uniq() |> Enum.map(fn x -> a |> Enum.chunk_by(fn y -> y == x end) |> Enum.filter(fn y -> y |> hd != x end) |> Enum.map(&length/1) |> Enum.max(&>=/2, fn -> 0 end) |> (&(&1 + 1)).() end) |> Enum.max() end end