a = int(eval(input()))



print((a + a ** 2 + a ** 3))
#!/usr/bin/env pypy3





def main():

    a = int(eval(input()))

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





if __name__ == '__main__':

    main()

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

#!/usr/bin/env pypy3
def main():
    a = int(eval(input()))
    print((a + a**2 + a**3))


if __name__ == "__main__":
    main()

-a = int(eval(input())) -print((a + a**2 + a**3)) +#!/usr/bin/env pypy3 +def main(): +    a = int(eval(input())) +    print((a + a**2 + a**3)) + + +if __name__ == "__main__": +    main()