Original: He qualified to compete in three team and five individual events, swimming seventeen races in nine days and winning the gold medal in all eight events.
Simplified: Phelps qualified to compete in three team and five individual events.