a = int(eval(input()))

b = [3, 14, 39, 84, 155, 258, 399, 584, 819, 1110]

print((b[a-1]))
def main():

    a = int(eval(input()))

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



if __name__ == "__main__":

    main()
a = int(eval(input()))
b = [3, 14, 39, 84, 155, 258, 399, 584, 819, 1110]
print((b[a - 1]))

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


if __name__ == "__main__":
    main()

-a = int(eval(input())) -b = [3, 14, 39, 84, 155, 258, 399, 584, 819, 1110] -print((b[a - 1])) +def main(): +    a = int(eval(input())) +    print((int(a + a * a + a**3))) + + +if __name__ == "__main__": +    main()