#!/bin/python3 import sys def sumOfGroup(k): # Return the sum of the elements of the k'th group. elements = [] for i in range(0,k): elements.append(k*(k-1)+1+2*i) return sum(elements) if __name__ == "__main__": k = int(input().strip()) answer = sumOfGroup(k) print(answer)