//=Main Part==================================================================//
@inlinable
func main(_ args: [String]) -> Int32 {
  // Your code goes here
  let a = geti()
  print(a * (a * (a + 1) + 1))

  return 0
}

//=Utilities for Programming Contests=========================================//
import Foundation
// input
@discardableResult
@inlinable @inline(__always) func gets() -> String { readLine()! }
@inlinable @inline(__always) func geti() -> Int    { Int(gets())! }
@inlinable @inline(__always) func getd() -> Double { Double(gets())! }
// array
@inlinable @inline(__always) func getsA(_ c: Character = " ") -> [String] { gets().split(separator: c).map(String.init) }
@inlinable @inline(__always) func getiA(_ c: Character = " ") -> [Int]    { gets().split(separator: c).map{ Int(String.init($0))! } }
@inlinable @inline(__always) func getdA(_ c: Character = " ") -> [Double] { gets().split(separator: c).map{ Double(String.init($0))! } }
// structured bindings: splat
prefix operator *
@inlinable @inline(__always) prefix func * <E> (a: [E]) -> (E, E)       { (a[0], a[1]) }
@inlinable @inline(__always) prefix func * <E> (a: [E]) -> (E, E, E)    { (a[0], a[1], a[2]) }
@inlinable @inline(__always) prefix func * <E> (a: [E]) -> (E, E, E, E) { (a[0], a[1], a[2], a[3]) }

//=Execution==================================================================//
exit(main(CommandLine.arguments))
