#!/bin/python3 import sys def sumOfGroup(k): # first get the the first element of the kth set # ie k = 4, k1 is the ((1 + 2 + 3) + 1)th element of the odd number sequence # use a for loop k1 = 1 for i in range(0,k): k1 += i # all odd numbers are written as 2k-1 # so we can form the sum of the set using this notation sum_k = 0 for i in range(0,k): sum_k += 2*(k1+i) - 1 return sum_k if __name__ == "__main__": k = int(input().strip()) answer = sumOfGroup(k) print(answer)