while True: try: n = int(input()) sum = 2 for i in range(1, n): number = 2 + 3 * i sum += number print(sum) except: break