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