What is the ideal number of years of foreign language in high school?

But will it hurt my admissions chances if I do a class I’m passionate about instead of a foreign language?