import sys
sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    a = int(rl())
    print(a + a ** 2 + a ** 3)


if __name__ == '__main__':
    solve()

9f1a3b2844b1b29eb457e684fd89893130af6738
<mask token>


def solve():
    a = int(rl())
    print(a + a ** 2 + a ** 3)


<mask token>

<mask token>
sys.setrecursionlimit(10 ** 7)
<mask token>


def solve():
    a = int(rl())
    print(a + a ** 2 + a ** 3)


if __name__ == '__main__':
    solve()

<mask token>
sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    a = int(rl())
    print(a + a ** 2 + a ** 3)


if __name__ == '__main__':
    solve()

import sys
sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    a = int(rl())
    print(a + a ** 2 + a ** 3)


if __name__ == '__main__':
    solve()
