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