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):
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 * a) + (a * a * a))

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 = input()

a = int(a)

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

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

Solution (Python):
pl = input()

aa = int(pl)










print(aa*(1+aa*(1+aa)))

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*a+a*a*a)

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

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

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

Solution (Python):
import sys
sys.setrecursionlimit(2147483647)
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**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())

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**2+a**3)

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

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

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

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):
x = int(input())

print(x + (x ** 2) + (x ** 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**2 + a**3 + a)

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

Solution (Python):
a = int(input())
print(((a + 1) * a + 1) * 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):
inp = input()

out = int(inp) + int(inp)**2 + int(inp)**3

print(out)

Solution (Python):
def result(x):
 return x + x ** 2 + x ** 3;

n = int(input())
print(result(n))

Solution (Python):


def calc(a):
    return a + (a ** 2) + (a ** 3)

a = int(input())
print(calc(a))

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

print(x+x**2+x**3)

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

main()

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

Solution (Python):
a=int(input())
b=a
for i in range(2,4):
    a=a+b**i
print(a)

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

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())
output = a + a**2 + a**3
print(output)

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

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

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

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

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

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

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

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

a=a+(a*a)+(a*a*a)

print(a)

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

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

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

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):
from collections import deque
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import product,permutations,combinations,combinations_with_replacement
from collections import defaultdict,Counter
from bisect import bisect_left,bisect_right
from math import gcd,ceil,floor,factorial

from functools import reduce
from pprint import pprint
from statistics import mean,median,mode

INF = float("inf")

def mycol(data,col):
    return [ row[col] for row in data ]

def mysort(data,col,reverse_flag):
    data.sort(key=lambda x:x[col],reverse=reverse_flag)
    return data

def mymax(data):
    M = -1*float("inf")
    for i in range(len(data)):
        m = max(data[i])
        M = max(M,m)
    return M

def mymin(data):
    m = float("inf")
    for i in range(len(data)):
        M = min(data[i])
        m = min(m,M)
    return m

def mycount(ls,x):
    
    l = bisect_left(ls,x)
    r = bisect_right(ls,x)
    return (r-l)

def myoutput(ls,space=True):
    if space:
        if len(ls)==0:
            print(" ")
        elif type(ls[0])==str:
            print(" ".join(ls))
        elif type(ls[0])==int:
            print(" ".join(map(str,ls)))
        else:
            print("Output Error")
    else:
        if len(ls)==0:
            print("")
        elif type(ls[0])==str:
            print("".join(ls))
        elif type(ls[0])==int:
            print("".join(map(str,ls)))
        else:
            print("Output Error")

def I():
    return int(input())

def MI():
    return map(int,input().split())

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

def CI(n):
    return [ int(input()) for _ in range(n) ]

def LI(n):
    return [ list(map(int,input().split())) for _ in range(n) ]

def S():
    return input()

def MS():
    return input().split()

def RS():
    return list(input().split())

def CS(n):
    return [ input() for _ in range(n) ]

def LS(n):
    return [ list(input().split()) for _ in range(n) ]







a = I()
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*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(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*a)+(a*a*a))

Solution (Python):
def f(x):
    a_1 = x
    a_2 = x**2
    a_3 = x**3
    return a_1 + a_2 + a_3 


if __name__ == "__main__":
    n = int(input())
    print(f(n))

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*a + a*a*a)

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):
a = int(input().strip())
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+a**2+a**3)

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

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

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

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**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):
num = int(input())
print(num + (num*num) + (num*num*num))

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**2 + a**3)

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

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

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())
ans = a*(1+a*(1+a))
print(ans)

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

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**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 re
import sys
try:
  a = int(input())
  if not 1 <= a <= 10:
    sys.exit()
  print(a+(a**2)+(a**3))
except:
  sys.exit()

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())
b = a + a*a + a*a*a
print(b)

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

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):
input = int(input())
print (input + input ** 2 + input ** 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*a)+a*a*a)

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

Solution (Python):
x = int(input())
calc = x + (x * x) + (x * x * x)
print(calc)

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

Solution (Python):



def main():
    import sys
    input = sys.stdin.readline

    a = int(input())

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


if __name__ == '__main__':
    main()

Solution (Python):
import sys

if sys.subversion[0] == "PyPy":
    import io, atexit

    sys.stdout = io.BytesIO()
    atexit.register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))

    sys.stdin = io.BytesIO(sys.stdin.read())
    input = lambda: sys.stdin.readline().rstrip()
RS = raw_input
RA = lambda x=int: map(x, RS().split())
RN = lambda x=int: x(RS())


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





a = RN()
solve()

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*a+a*a*a)

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

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.buffer.readline

a = int(readline())

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*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):

import sys
input = sys.stdin.readline



def swaparr(arr, a,b):
    temp = arr[a];
    arr[a] = arr[b];
    arr[b] = temp


def gcd(a,b):
    if b == 0:
        return a
    return gcd(b, a % b);


def nCr(n, k): 
    if(k > n - k): 
        k = n - k 
    res = 1
    for i in range(k): 
        res = res * (n - i) 
        res = res / (i + 1) 
    return int(res) 


def upper_bound(a, x, lo=0):
    hi = len(a)
    while lo < hi:
        mid = (lo+hi)//2
        if a[mid] < x:
            lo = mid+1
        else:
            hi = mid
    return lo


def primefs(n):
    
    primes = {}
    while(n%2 == 0 and n > 0):
        primes[2] = primes.get(2, 0) + 1
        n = n//2
    for i in range(3, int(n**0.5)+2, 2):
        while(n%i == 0 and n > 0):
            primes[i] = primes.get(i, 0) + 1
            n = n//i
    if n > 2:
        primes[n] = primes.get(n, 0) + 1
    
    
    return primes


def power(x, y, p): 
    res = 1
    x = x % p  
    if (x == 0) : 
        return 0
    while (y > 0) : 
        if ((y & 1) == 1) : 
            res = (res * x) % p 
        y = y >> 1      
        x = (x * x) % p 
    return res 


def swap(a,b):
    temp = a
    a = b
    b = temp
    return a,b









def find(x, link):
    p = x;
    while( p != link[p]):
        p = link[p];
    
    while( x != p):
        nex = link[x];
        link[x] = p;
        x = nex;
    return p;




def union(x, y, link, size):
    x = find(x, link)
    y = find(y, link)
    if size[x] < size[y]:
        x,y = swap(x,y)
    if x != y:
        size[x] += size[y]
        link[y] = x


def sieve(n): 
    prime = [True for i in range(n+1)] 
    p = 2
    while (p * p <= n): 
        if (prime[p] == True): 
            for i in range(p * p, n+1, p):
                prime[i] = False
        p += 1
    return prime


MAXN = int(1e7 + 5)
def spf_sieve():
    spf[1] = 1;
    for i in range(2, MAXN):
        spf[i] = i;
    for i in range(4, MAXN, 2):
        spf[i] = 2;
    for i in range(3, ceil(MAXN ** 0.5), 2):
        if spf[i] == i:
            for j in range(i*i, MAXN, i):
                if spf[j] == j:
                    spf[j] = i;
    




def factoriazation(x):
    ret = {};
    while x != 1:
        ret[spf[x]] = ret.get(spf[x], 0) + 1;
        x = x//spf[x]
    return ret
    
    


def int_array():
    return list(map(int, input().strip().split()))

def str_array():
    return input().strip().split();


MOD = int(1e9)+7;
CMOD = 998244353;
INF = float('inf'); NINF = -float('inf');



n = int(input());
ans = n * (1 + n * (1 + n));
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):

from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")


def solve():
    a = II()
    print(a + a ** 2 + a ** 3)
    return



if __name__ == '__main__':
    solve()

Solution (Python):
num = int(input())
 
answer = num + num * num + num * num * num
 
print(answer)

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())
s=a+a**2+a**3
print(s)

Solution (Python):
import sys
import math
import collections
import heapq
import queue
import itertools
import functools
import operator
import time

readline = sys.stdin.readline
 
IPS = lambda: readline().rstrip()
IP = lambda: int(readline().rstrip())
MP = lambda: map(int, readline().split())
LS = lambda: list(map(int, readline().split()))

def solve():
    for _ in range(1):
        n = IP()
        print(n + n**2 + n**3)
       
       
if __name__ == "__main__":
    solve()

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

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

calc = (a) + (a**2) + (a**3)

print(calc)

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())
b=a+a**2+a**3
print(b)

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):
a = int(input())
print(a+pow(a,2)+pow(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())
a = a + a**2 + a**3
print(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*a+a*a*a)

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

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

Solution (Python):
from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
    return int(input())

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


def solve():
    a = ri()
    print (a + a*a + a*a*a)





mode = 's'

if mode == 'T':
    t = ri()
    for i in range(t):
        solve()
else:
    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):
num = int(input())
print(num + (num * num) + (num * num * num))

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


main()

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 * 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*(1+a+a*a))
main()

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

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

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

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

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**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 + pow(n, 2) + pow(n, 3))

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

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

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

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

Solution (Python):
"""
// Author : snape_here - Susanta Mukherjee
     
 """
 
from __future__ import division, print_function
 
import os,sys
from io import BytesIO, IOBase
 
if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip
 
 
def ii(): return int(input())
def fi(): return float(input())
def si(): return input()
def mi(): return map(int,input().split())
def li(): return list(mi())
 
 
def read():
    sys.stdin = open('input.txt', 'r')  
    sys.stdout = open('output.txt', 'w') 

def isPrime(n):
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) : 
        if (n % i == 0 or n % (i + 2) == 0) : 
            return False
        i = i + 6
    return True

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

mod=1000000007

from math import *

import bisect

from decimal import *

getcontext().prec = 50

abc="abcdefghijklmnopqrstuvwxyz"

pi=3.141592653589793238

def main():

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



 
BUFSIZE = 8192
 
 
class FastIO(IOBase):
    newlines = 0
 
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
 
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
 
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
 
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
 
 
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
 
 
def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()
 
 
if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
 
input = lambda: sys.stdin.readline().rstrip("\r\n")
 

 
 
if __name__ == "__main__":
    
    main()

Solution (Python):

 
cmdvar_N=int(input())
tmp=cmdvar_N
for i in 2,3:
    tmp=tmp+cmdvar_N**i

print(tmp)

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

Solution (Python):


import copy
import random
import bisect 
import fractions 
import math
import sys
import collections
from decimal import Decimal 

mod = 10**9+7
sys.setrecursionlimit(mod) 

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))


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())
ans=a+a**2+a**3
print(ans)

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):
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 ** 3 + a ** 2 + 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):

def main():
    import sys
    imput = sys.stdin.readline
    
    
    
    a = int(input())

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

    
if __name__ == "__main__":
    main()

Solution (Python):
import sys

def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))
def RN(N): return [input().strip() for i in range(N)]


def main():
    a = II()



    
    print(a + pow(a,2) + pow(a,3))

if __name__ == "__main__":
	main()

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

Solution (Python):
a = int(input())
ans = 0
if 1 <= a <= 10:
    ans =  a + a*a + a**3
print(int(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())
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):
def calc(a: int) -> int:
    return a+a**2+a**3

if __name__ == "__main__":
    a = int(input())
    print(calc(a))

Solution (Python):
a = int(input())
print(format(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())
ans=a+a*a+a*a*a
print(ans)

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

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())
p=a+a**2+a**3
print(p)

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

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

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

Solution (Python):
print((a:=int(input()))-~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(int(a+a**2+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):
a = int(input())
ans = int(0)
for num in range(1,4):
	ans += a**num
print(ans)

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

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

Solution (Python):
a = int(input())
a2 = a*a
a3 = a2 * a

print(a + a2 + a3)

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

Solution (Python):




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


if __name__ == "__main__":
    main()

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

Solution (Python):
from sys import stdin
input = lambda: stdin.readline().rstrip("\r\n")
from collections import defaultdict as vector, deque as que
inin = lambda: int(input())
inar = lambda: list(map(int,input().split()))
from heapq import heappush as hpush,heappop as hpop

a=inin()
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**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):
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(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())
b = a * ((a + 1) * a + 1)
print(b)

Solution (Python):
a = int(input())
print(int(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):
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):
n = int(input())
k = n+n**2+n**3

print(k)

Solution (Python):
from sys import stdin
input = lambda: stdin.readline().rstrip("\r\n")
from collections import defaultdict as vector
from collections import deque as que
inin = lambda: int(input())
inar = lambda: list(map(int,input().split()))
from heapq import heappush as hpush,heappop as hpop

a=inin()
print(a+a*a+a*a*a)

Solution (Python):
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):
N=int(input())
print(N+N**2+N**3)

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

Solution (Python):
import itertools
import functools
import math
from collections import Counter
from itertools import combinations
import re


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**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):

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())

out = pow(a,1)+pow(a,2)+pow(a,3)

print(out)

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())
A = a + (a*a) + (a*a*a)

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 = list(map(int,input().split()))
print(a[0] + a[0]**2 + a[0]**3)