defmodule Main do def main do [p, q, n] = 1..3 |> Enum.map(fn _ -> IO.read(:line) |> String.trim() |> String.to_integer() end) s = 1..n |> Enum.map(fn _ -> IO.read(:line) |> String.trim() |> String.to_integer() end) solve(s, p, q) |> IO.puts() end def solve(s, p, q) do ((s |> length) - (s |> Enum.uniq() |> length)) * (p + q) end end