x = int(input()) if x > 0: y = 0.375*x**3 - 0.75*x**2 + 1.625*x + 0.75 print(y) else: print(0.375*n**3 - 0.75*n**2 + 1.625*n + 0.75)