I don't know about a "magic" number - it doesn't work that way. You can theoretically apply for 15 residency programs and not match into any one of them. The idea is that you rank the programs that YOU like and interviewed well with, and hopefully these programs would rank you high on their list. I know people who ranked 3-4 programs and still matched with no problems. I think the national average was more than 70% of the students matching and the rest scrambled. These numbers change every year. The key is to do well as a student, pass your boards, work hard and learn during your rotations, interview well, and rank the programs as you like them.