#!/usr/bin/env python3

import sys

sys.setrecursionlimit(10**8)

INF = float("inf")





def input():

    return sys.stdin.readline().strip()





def INT():

    return int(eval(input()))





def MAP():

    return list(map(int, input().split()))





def LIST():

    return list(map(int, input().split()))





def ZIP(n):

    return list(zip(*(MAP() for _ in range(n))))





def main():

    a = INT()

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

    return





if __name__ == '__main__':

    main()

#!/usr/bin/env python3

import sys

def input(): return sys.stdin.readline().strip()

def INT(): return int(eval(input()))

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

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

def ZIP(n): return list(zip(*(MAP() for _ in range(n))))



def main():

    sys.setrecursionlimit(10**8)

    INF = float("inf")



    a = INT()

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

    return





if __name__ == '__main__':

    main()

#!/usr/bin/env python3
import sys

sys.setrecursionlimit(10**8)
INF = float("inf")


def input():
    return sys.stdin.readline().strip()


def INT():
    return int(eval(input()))


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


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


def ZIP(n):
    return list(zip(*(MAP() for _ in range(n))))


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


if __name__ == "__main__":
    main()

#!/usr/bin/env python3
import sys


def input():
    return sys.stdin.readline().strip()


def INT():
    return int(eval(input()))


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


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


def ZIP(n):
    return list(zip(*(MAP() for _ in range(n))))


def main():
    sys.setrecursionlimit(10**8)
    INF = float("inf")
    a = INT()
    print((a + a**2 + a**3))
    return


if __name__ == "__main__":
    main()

- -sys.setrecursionlimit(10**8) -INF = float("inf") +    sys.setrecursionlimit(10**8) +    INF = float("inf")