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