Dependence of the maximal superconducting current on the resonance frequency in a shunted Josephson junction