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