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