The Lovelock gravity in the critical spacetime dimension