' Imports System.Collections.Generic
' Imports System.Linq
' Imports System.Text
' Imports System.Text.RegularExpressions

Class Main
    Public Shared Sub Main()
        Dim a As Integer = Console.ReadLine()
        Console.WriteLine(a + a ^ 2 + a ^ 3)
        Return
    End Sub
End Class