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