k = int(input()) n = 1 + k*(k-1) res = n*k + k*(k-1) print(res)