k = int(input()) print((2 * k + 1) ** 2 - (2 * k + 1) - 2 * (k - 1))