program example
	implicit none

	integer L
    real(8) x,y
    
    read(*,*) L
    
    if(mod(L,3)==0) then
    	write(*,*) (dble(L)/3)**3
    else
    	x=(dble(L)/3.0d0)
        y=dble(L)-(2.0d0*x)
        
        write(*,*) (x**2)*y
    end if
    
end program example