#!/bin/python

import sys

def oddnum(p):
    count=1
    n=1
    while count<=p:
        n+=2
        count+=1
    return n
        
    

def sumOfGroup(k):
    i=1
    j=1
    while i<k:            # Return the sum of the elements of the k'th group.
        j+=i
        i+=1
    grpstr=oddnum(k)
    sumgrp=0
    for m in range(0,k):
        sumgrp+=grpstr
        grpstr+=2
    return sumgrp
        
        
    

if __name__ == "__main__":
    k = int(raw_input().strip())
    answer = sumOfGroup(k)
    print answer