K =int(input()) print(4 * K**2 + 2)