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) cond do a < b -> IO.puts d * (a - b) + b * d a >= b -> IO.puts d * b end end end