import math k = int(input()) print(math.ceil((2 * k + 1)**2 / 2) + math.ceil((2 * k - 1)** 2 / 2))