The 40 men who wrote the bible lived in how many countries?

It's not certain that exactly 40 people wrote the Bible. They would have lived in the Middle East, around what is now Turkey, Lebanon, Syria, Israel, Egypt, Iraq. Don't forget that that whole area has been under many different rulers; borders and names of areas have changed many times over the hundreds of years of writing the Bible, and have changed many times in more recent years.