64 copies.
1.) Divide 40 by 5 (you get 8)
2.) 8 is the number of copies that fits on a 1 foot shelf, so to find how many copies would fit on an 8 foot shelf, simply multiply 8(book copies) by 8( an 8 foot shelf).
3.) 8 times 8 is 64, so your answer is 64 books will fit perfectly on an 8 foot shelf. Hope this helped!