defmodule Main do def main do d = IO.read(:line) |> String.trim |> String.to_integer; [a, b] = IO.read(:line) |> String.trim |> String.split(" ") |> Enum.map(&String.to_integer/1) x = d; IO.puts x * a + (d - x) * b ; end end