Strong-coupling theory of high-temperature superconductivity