https://www.nowcoder.com/practice/f792cb014ed0474fb8f53389e7d9c07f?tpId=37&tags=&title=&diffculty=0&judgeStatus=0&rp=1 while True: try: n = int(input()) ans = 2*n + (3 * n * (n - 1)) / 2 print(int(ans)) except: break