Imports System
Imports System.Linq

Class Program
    Shared Sub Main(args As String())
        Dim a As Integer = CInt(Console.ReadLine())
        Console.WriteLine(a + a * a + a * a * a)
    End Sub
End Class