K = int(input()) if K & 1:ans = 2 else:ans = 1 print(4 * K * K + K + 1 + ans)