Problem:
 Score : 100 points    Problem Statement Given an integer a as input, print the value a + a^2 + a^3 .      Constraints  1 \leq a \leq 10  a is an integer.         Input Input is given from Standard Input in the following format:  a       Output Print the value a + a^2 + a^3 as an integer.        Sample Input 1 2      Sample Output 1 14  When a = 2 , we have a + a^2 + a^3 = 2 + 2^2 + 2^3 = 2 + 4 + 8 = 14 .  Print the answer as an input. Outputs such as 14.0 will be judged as incorrect.       Sample Input 2 10      Sample Output 2 1110

Solution (Python):
def main():
    a = int(input())
    print(a + a ** 2 + a ** 3)

if __name__ == "__main__":
    main()

Solution (Python):
a = int(input())
print(a+a*a+a*a*a)

Solution (Python):
a = int(input())
print(a + a * a + a* a* a)

Solution (Python):
n=int(input())
ans=n+n**2+n**3
print(ans)

Solution (Python):
n = int(input())

print(n+n**2+n**3)

Solution (Python):
a = int(input())
print(a + a * a + a * a * a)

Solution (Python):
n = int(input())
print(n + n ** 2 + n ** 3)

Solution (Python):
import sys 
input = lambda:sys.stdin.readline().strip()
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
a = int(input())





print(a + a**2 + a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
import sys
input = sys.stdin.readline

def main():
    n = int(input())
    print(n+n*n+n*n*n)

if __name__ == '__main__':
    main()

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

a = int(input())
print(a+a**2+a**3)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):

def resolve():
    a = int(input())
    print(a + a**2 + a**3)
if __name__ == "__main__":
    resolve()

Solution (Python):
a = int(input())

print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a+a*a+a*a*a)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
n = int(input())

print(n+n**2+n**3)

Solution (Python):
import sys
read = sys.stdin.read
from math import gcd
from math import floor
def main():
    a = int(input())
    r = a + a**2 + a**3
    print(r)

if __name__ == '__main__':
    main()

Solution (Python):
a = int(input())
print(a+a*a + a**3)

Solution (Python):
a = int(input())
print(a + a*a + a*a*a);

Solution (Python):
a = int(input())

print(a + a**2 + a**3)

Solution (Python):
i = int(input())
print(i+i*i+i*i*i)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
import math
from collections import defaultdict
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:list(input())
ips=lambda:input().split()

"""========main code==============="""

n=ii()
print(n+n*n+n*n*n)

Solution (Python):
a=int(input())

print(a+a*a+a*a*a)

Solution (Python):
a = int(input())

print(a + a**2 + a**3)

Solution (Python):
a = int(input())
print(a + (a**2) + (a**3))

Solution (Python):
a = int(input())

print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a=int(input())
print(int(a+(a**2)+(a**3)))

Solution (Python):
import sys
def I(): return int(sys.stdin.readline().rstrip())
a = I()
print(a+a**2+a**3)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce
from decimal import Decimal, getcontext

def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    n = i_input()

    print(n + pow(n, 2) + pow(n, 3))
 
if __name__ == '__main__':
    main()

Solution (Python):
a=int(input())


print(a+a**2+a**3)

Solution (Python):
import sys
input=sys.stdin.readline
a=int(input())
ans=a+a**2+a**3
print(ans)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
import sys
input = sys.stdin.readline

if __name__ == '__main__':
  a=int(input())
  print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
def main():
    a = int(input())
    print(a + a**2 + a**3)


if __name__ == '__main__':
    main()

Solution (Python):
a = int(input())

print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(raw_input())
print a + (a ** 2) + (a ** 3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())

print(a+(a**2)+(a**3))

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a+ a**2 + a**3)

Solution (Python):
a = int(input())
print(a + a * a + a * a * a)

Solution (Python):
a = int(input())
print(a+pow(a,2)+pow(a,3))

Solution (Python):
a = int(input())
print(a + pow(a,2) + pow(a,3))

Solution (Python):
a = int(input())

print(a + a**2 +a **3)

Solution (Python):
a=int(input())
print(a+(a*a)+(a*a*a))

Solution (Python):
a = int(input())

print(int(a+a**2+a**3))

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
from sys import stdin, setrecursionlimit

setrecursionlimit(10 ** 7)

from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
from collections import deque, defaultdict, Counter
from itertools import combinations, permutations, combinations_with_replacement
from itertools import accumulate
from math import ceil, sqrt, pi, radians, sin, cos

MOD = 10 ** 9 + 7
INF = 10 ** 18

A = int(input())






print(A ** 3 + A ** 2 + A)

Solution (Python):
N = int(input())
print(N + N * N + N * N * N)

Solution (Python):
import sys
import math
import heapq
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, m=DVSR): return pow(x, m - 2, m)
def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def FLIST(n):
    res = [1]
    for i in range(1, n+1): res.append(res[i-1]*i%DVSR)
    return res

a=II()
print(a + a*a + a*a*a)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
a = int(input())

print(a + a**2 + a**3)

Solution (Python):
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
n=int(input())
print(n+(n*n)+(n*n*n))

Solution (Python):
N = int(input())

print(N + N**2 + N**3)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
n=int(input())
print(n**2+n+n**3)

Solution (Python):
from sys import stdin

a = int(input())

print(a+a**2+a**3)

Solution (Python):
import math

a = int(input())

print(a**3 + a**2 + a)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):


import sys
stdin = sys.stdin

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

def main():
    a = ni()
    print(a + a**2 + a**3)

if __name__ == "__main__":
    main()

Solution (Python):
a = int(input())
print(a + a * a + a * a * a)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
a = int(input())

print (a + a * a + a * a * a)

Solution (Python):
def main():
    N = int(input())
    print(N + N * N + N * N * N)


if __name__ == '__main__':
    main()

Solution (Python):
a = int(input())

print(a + a**2 + a**3)

Solution (Python):
a = int(input())

print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a+a*a+a*a*a)

Solution (Python):
a = int(input())
ans = a + a**2 + a**3
print (ans)

Solution (Python):
a = int(input())
print(a + a ** 2 + a ** 3)

Solution (Python):
a = int(input())
print(a+a*a+a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
ans = a + a**2 + a**3
print(ans)

Solution (Python):

import sys
input = sys.stdin.readline

a = int(input())
print(a + a**2 + a**3)

Solution (Python):
n=  (int)(input())
print(n + n * n + n * n * n)

Solution (Python):
a = int(input())

print(a + a**2 + a**3)

Solution (Python):
a = int(input())

print(a + a**2 + a**3)

Solution (Python):
a = int(input())
print(a + a ** 2 + a ** 3)

Solution (Python):
a = int(input())
print(a + a * a + a * a * a)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())

print(a + a**2+a**3)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
a = int(input())
res = a + a * a + a * a * a
print(res)

Solution (Python):

n = int(input())


print(n + n**2 + n**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
import sys
sys.setrecursionlimit(10000000)
import math
import bisect
from collections import deque
def input():
    return sys.stdin.readline()[:-1]

a = int(input())
print(a+a**2+a**3)

Solution (Python):
import sys
input = sys.stdin.readline


def read():
    A = int(input().strip())
    return A,


def solve(a):
    return a + a * a + a * a * a


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

Solution (Python):
a = int(input())

print(a+a**2+a**3)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    a = int(input())
    print(a + a ** 2 + a ** 3)
    

if __name__ == '__main__':
    main()

Solution (Python):
a = int(input())
print(a+a*a+a**3)

Solution (Python):
a = int(input())
print(a+a*a+a*a*a)

Solution (Python):
a = int(input())
print(a + a * a + a*a*a)

Solution (Python):
s = int(input())
print(s + s**2 + s**3)

Solution (Python):
a = int(input())

print(a + a ** 2 + a ** 3)

Solution (Python):
a=int(input())
ans=a+a**2+a**3
print(ans)

Solution (Python):
a = int(input())
print(a + a * a + a * a * a)

Solution (Python):
a=int(input())
print(a+a*a+a**3)

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    a = int(readline())
    print(a + a ** 2 + a ** 3)


if __name__ == '__main__':
    main()

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
n = int(input())
print(n+n**2+n**3)

Solution (Python):
import sys
input = sys.stdin.readline

a = int(input())

print(a + a*a + a*a*a)

Solution (Python):
a = int(input())
ans = a+a**2+a**3
print(ans)

Solution (Python):
a = int(input())

print( a + a*a + a*a*a)

Solution (Python):
a = int(input())

print(a + (a*a) + (a*a*a))

Solution (Python):
a = int(input())

print(a + a**2 + a**3)

Solution (Python):

n = int(input())
print(n+n**2+n**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a+a*a+a*a*a)

Solution (Python):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

a = ni()
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
from math import gcd

from math import factorial as f

from math import ceil,floor,sqrt
import math

import bisect
import re
import heapq


from copy import deepcopy
import itertools
from itertools import permutations

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))


yes = "Yes"
no = "No"


def main():
    a = ii()
    print(a+a**2+a**3)




main()

Solution (Python):
n=int(input())
a=n+n**2+n**3
print(a)

Solution (Python):
a = int(input())
print(a + a*a + a*a*a)

Solution (Python):
a = int(input())

print(a + a**2 + a**3)

Solution (Python):
a = int(input())
print(a + a ** 2 + a ** 3)

Solution (Python):
a = int(input())
print(a+a*a+a*a*a)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a + a ** 2 + a ** 3)

Solution (Python):
a = int(input())

print(a + a ** 2 + a ** 3)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):

import sys,io,os,time
from collections import defaultdict
from collections import OrderedDict
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect,math,heapq
alphabet = "abcdefghijklmnopqrstuvwxyz"

input = sys.stdin.readline




a = int(input())
print(a + a*a + a*a*a)

Solution (Python):
a = int(input())
print(a + a * a + a * a * a)

Solution (Python):
n = int(input())
print(n+n**2+n**3)

Solution (Python):
def main():
    i = int(input())
    print(i**3+i**2+i)


main()

Solution (Python):
a = int(input())
print(a+a*a+a*a*a)

Solution (Python):
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

def main():
    a = ii()
    print(a+(a**2)+(a**3))




if __name__ == "__main__":
    main()

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
n=int(input())
print(n+n**2+n**3)

Solution (Python):
a = int(input())

print(a+a*a+a**3)

Solution (Python):
a = int(input())
print(a+a*a+a**3)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())

print(a + a ** 2 + a ** 3)

Solution (Python):
import sys
import math

a=int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
N = int(input())
print(N+N**2+N**3)

Solution (Python):
a = int(input())
print(a + a ** 2 + a ** 3)

Solution (Python):
n = int(input())
print(n+n**2+n**3)

Solution (Python):
a = int(input())
print(a + a * a + a * a * a)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())

print(a+a**2+a**3)

Solution (Python):

a=int(input())

print(a+a**2+a**3)

Solution (Python):
a = input()
print a + a ** 2 + a ** 3

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):

import sys
sys.setrecursionlimit(10**8)
input = sys.stdin.readline

a = int(input())
print(a+a*a+a*a*a)

Solution (Python):
a = int(input())
print(a+a*a+a*a*a)

Solution (Python):
a = int(input())
ans = a + a**2 + a*a*a
print(ans)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a + a ** 2 + a ** 3)

Solution (Python):

a = int(input())
print(a+a**2+a**3)

Solution (Python):
n = int(input())
print(n+n*n+n*n*n)

Solution (Python):
n = int(input())
print(int(n+n**2+n**3))

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())

print(a+a*a+a**3)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
S=lambda:input()
I=lambda:int(input())
L=lambda:list(map(int,input().split()))
LS=lambda:list(map(str,input().split()))

a=I()
print(a+a*a+a*a*a)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
A = int(input())
print(A+A*A+A*A*A)

Solution (Python):
a = int(input())
print(a + a ** 2 + a ** 3)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

a = int(input())

print(a + a ** 2 + a ** 3)

Solution (Python):
def main():

    a = int(input())
    return a + a *a + a * a * a

if __name__ == '__main__':
    print(main())

Solution (Python):
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]

def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  a=I()
  return a+(a*a)+(a*a*a)


print(main())

Solution (Python):
a=int(input())
print(a+a*a+a*a*a)

Solution (Python):

a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
import sys
readline = sys.stdin.readline


def main():
    a = int(readline())
    print(a + a ** 2 + a ** 3)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
x = n**2
y = n**3
print(n+x+y)

Solution (Python):
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

a=int(input())
print(a+a**2+a**3)

Solution (Python):
import sys
input = sys.stdin.readline

'''

'''

a = int(input())
print(a+a**2+a**3)

Solution (Python):
n = int(input())
print(n + n**2 + n**3)

Solution (Python):
a = int(input())
print(a + a * a + a * a * a)

Solution (Python):
import sys

def solve():
      input = sys.stdin.readline
      A = int(input())
      print(A + A ** 2 + A ** 3)
      return 0

if __name__ == "__main__":
      solve()

Solution (Python):
a = int(input())
print(a + a*a + a*a*a)

Solution (Python):
N = int(input())
ans = N + N**2 + N**3
print(ans)

Solution (Python):
n = int(input())
print (n+n**2+n**3)

Solution (Python):
a = int(input())
print(a + pow(a, 2) + pow(a, 3))

Solution (Python):
a = int(input())
print(a+a*a+a*a*a)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
def main():
    a = int(input())
    print(a + (a**2) + (a**3))

if __name__ == "__main__":
    main()

Solution (Python):
a=int(input())
print(a+a*a+a*a*a)

Solution (Python):
def main():
    n = int(input())
    print(n + n ** 2 + n ** 3)


if __name__ == '__main__':
    main()

Solution (Python):

from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right

def main():
    a = int(input())
    print(a+a**2+a**3)

if __name__ == "__main__":
    main()

Solution (Python):
def solve():
    a = int(input())
    print(a + a**2 + a**3)
if __name__ == '__main__':
    solve()

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
n = int(input())
print(n+n*n+n*n*n)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
import sys
readline = sys.stdin.readline

def solve():
    A = int(readline())

    print(A + A**2 + A**3)

solve()

Solution (Python):
a = int(input())
print(a + a ** 2 + a ** 3)

Solution (Python):
a = int(input())
print(a+a*a+a*a*a)

Solution (Python):
def main():
	k = int(input())
	
	print(int(k + k**2 + k**3))


if __name__ == '__main__':
	main()

Solution (Python):
a = int(input())
print(a+a*a+a*a*a)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
import sys
import math
from collections import deque
import heapq
import itertools
from decimal import Decimal
import bisect
from operator import itemgetter
MAX_INT = int(10e18)
MIN_INT = -MAX_INT
mod = 1000000000+7
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

a = I()

print(a+a**2+a**3)

Solution (Python):
"""
    こんにちは。これはクシャルです
    
    Author : thekushalghosh (クシャル)
    Team   : CodeDiggers
 
    I prefer Python language over the C++ language :p :D
        
    Visit my website : thekushalghosh.github.io
"""
import sys,math,cmath,time
start_time = time.time()



def solve():
    n = inp()
    print(n + n ** 2 + n ** 3)
            


 
def main():
    global tt
    if not ONLINE_JUDGE:
        sys.stdin = open("input.txt","r")
        sys.stdout = open("output.txt","w")
    t = 1
    for tt in range(t):
        solve()
    if not ONLINE_JUDGE:
        print("Time Elapsed :",time.time() - start_time,"seconds")
        sys.stdout.close()
    

def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    return(input().strip())
def invr():
    return(map(int,input().split()))
 

def counter(a):
    q = [0] * max(a)
    for i in range(len(a)):
        q[a[i] - 1] = q[a[i] - 1],1
    return(q)
 
def string_counter(a):
    q = [0] * 26
    for i in range(len(a)):
        q[ord(a[i]) - 97] = q[ord(a[i]) - 97],1
    return(q)

def factors(n):
    q = []
    for i in range(1,int(n ** 0.5) + 1):
        if n % i == 0: q.append(i); q.append(n // i)
    return(list(sorted(list(set(q)))))

def prime_factors(n):
    q = []
    while n % 2 == 0: q.append(2); n = n // 2
    for i in range(3,int(n ** 0.5) + 1,2):
        while n % i == 0: q.append(i); n = n // i
    if n > 2: q.append(n)
    return(list(sorted(q)))


        
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
    input = sys.stdin.readline
main()

Solution (Python):
import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    sys.setrecursionlimit(10**7)
    INF = 10**18
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    _LI = lambda : [-int(x) for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())
    SI = lambda : sys.stdin.readline().rstrip()
    DD = ((1,0),(0,1),(-1,0),(0,-1))

    a = NI()
    print(a + a*a + a*a*a)

if __name__ == '__main__':
    main()

Solution (Python):

a=int(input())

print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a + a **2 + a ** 3)

Solution (Python):




a = int(input())


r = a + a ** 2 + a ** 3
print(r)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a + a * a + a * a * a)

Solution (Python):
a = int(input())

ans = a + a ** 2 + a ** 3
print(ans)

Solution (Python):
a = int(input())
print(a + a * a + a * a * a)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):

a = int(input())
print(a + a**2 + a**3)

Solution (Python):
n = int(input())
print(n+n*n+n*n*n)

Solution (Python):
a = int(input())
print(a + a**2 + a**3)

Solution (Python):
a = int(input())

print(a + a**2 + a**3)

Solution (Python):
a = int(input())
print(a + a*a + a*a*a)

Solution (Python):
a = int(input())

print(a + a**2 + a**3)

Solution (Python):
a = int(input())
print(a+a**2 + a**3)

Solution (Python):



def mp(): return map(int, input().split())
def lmp(): return list(map(int, input().split()))


a = int(input())
print(a+a*a+a*a*a)

Solution (Python):
a = int(input())
print(a + a**2 + a** 3)

Solution (Python):
a = int(input())

print(a + a ** 2 + a ** 3)

Solution (Python):
a = int(input())
print(a+a*a+a*a*a)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from math import factorial, sqrt, ceil, gcd
from functools import lru_cache, reduce
from decimal import Decimal
from operator import mul

INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)



class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def dijkstra_heap(s, edge, n):
    
    d = [10**20] * n
    used = [True] * n 
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


def combinations_count(n, r):
    if n < r:
        return 0
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


def lcm(x, y):
    return (x * y) // gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm, numbers, 1)


def gcd_list(numbers):
    return reduce(gcd, numbers)


def is_prime(n):
    if n <= 1:
        return False
    p = 2
    while True:
        if p ** 2 > n:
            break
        if n % p == 0:
            return False
        p += 1
    return True



def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []

    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P


def permutation_with_duplicates(L):

    if L == []:
        return [[]]

    else:
        ret = []

        
        S = sorted(set(L))

        for i in S:

            data = L[:]
            data.remove(i)

            for j in permutation_with_duplicates(data):
                ret.append([i] + j)

        return ret

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]


a = int(input())
ans = a + a ** 2 + a ** 3
print(ans)

Solution (Python):
a = int(input())
print(a+a*a+a*a*a)

Solution (Python):
def main():
    a = int(input())
    return a + a**2 + a**3
print(main())

Solution (Python):
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  
def LS2(): return list(sys.stdin.readline().rstrip())  

a = I()

print(a+a**2+a**3)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a + a ** 2 + a ** 3)

Solution (Python):
a = int(input())

print(a + a**2 + a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):









def solve():
    a = int(input())

    return a + a ** 2 + a ** 3


def main():
    print(solve())


if __name__ == "__main__":
    main()

Solution (Python):
A = int(input())
print(A+A**2+A**3)

Solution (Python):
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

a = ri()

print(a+a**2+a**3)

Solution (Python):
import sys
import os
import itertools
import numpy as np
from collections import deque

def main():
    if os.getenv("ENV")=='LOCAL':
        sys.stdin = open(os.path.dirname(__file__)+'/input.txt', 'r')

    a=int(input())

    print(a+a*a+a*a*a)

if __name__ == '__main__':
    main()

Solution (Python):
a=int(input())
print(a+(a*a)+(a*a*a))

Solution (Python):
a=int(input())
print(a+a*a+a*a*a)

Solution (Python):
def main():
    a = int(input())
    print(a+a**2+a**3)
    

if __name__ == '__main__':
    main()

Solution (Python):


a=int(input())
print(a+a**2+a**3)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a + a ** 2 + a ** 3)

Solution (Python):
a = int(input())

print(a + a*a + a*a*a)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a=int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())
print(a+a**2+a**3)

Solution (Python):
a = int(input())

print(a + a**2 + a**3)