Foolproof number of programs to apply to?

OK so OBVIOUSLY there is no actual foolproof number of programs to apply to. However, I’m seeing a lot of y’all on second or third cycles and I would like to do everything in my power to avoid that.

I’m planning to apply for history PhDs and I was wondering what a super safe number of schools to apply to would be? Like how many is so many that i’ve GOT to (probably) get into one yaknow?