#!/bin/python import sys def sumOfGroup(k): # Return the sum of the elements of the k'th group. nthelement = ((k-1)*k/2)+1 odd = 2*nthelement - 1 sum= 0 while(k): sum = sum + odd odd += 2 k -= 1 return sum if __name__ == "__main__": k = int(raw_input().strip()) answer = sumOfGroup(k) print answer