
defmodule Solve do
    def exec() do
    	org = inpin()
        res = org
        res = res + :math.pow(org, 2) |> round
        res = res + :math.pow(org, 3) |> round
        
        IO.puts res
    end
    
    defp inpin() do
    	IO.gets("") |> String.to_integer()
    end
end

Solve.exec()

