#1491 銀将

k=int(input())

result=(2*(k-1)+1)*(k+1+(k-2)) + ((k+1+(k-2))//2+1)*2 + ((2*k+1)//2) +((2*k+1)//2+1)
print(result)