module Main where

import Control.Monad
import Control.Applicative
import Data.List

showingList :: [Int] -> String
showingList (x:[]) = show x
showingList (x:xs) = (show x) ++ " " ++ (showingList xs)


main :: IO ()
main = do
    x <- readLn
    print $ x + x * x + x * x * x
