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