We theoretically study the problem of Raman gain maximization in uniform silicon photonic-crystal waveguides supporting slow optical modes. For the first time, an exact solution to this problem is obtained within the framework of the undepleted-pump approximation. Specifically, we derive analytical expressions for the maximum signal gain, optimal input pump power, and optimal length of a silicon Raman amplifier and demonstrate that the ultimate gain is achieved when the pump beam propagates at its maximum speed. If the signals group velocity can be reduced by a factor of 10 compared to its value in a bulk silicon, it may result in ultrahigh gains exceeding 100dB. We also optimize the device parameters of a silicon Raman amplifier in the regime of strong pump depletion and come up with general design guidelines that can be used in practice.