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