x=int(input()) l=[] i=((x-1)*x)/2 a1=int(1+(i)*2) sum1=a1 l.append(a1) for i in range(x-1): sum1=sum1+2 l.append(sum1) print(sum(l))