2005 AIME I Problem 11

A semicircle with diameter d is contained in a square whose sides have length 8. Given that the maximum value of d is m-\sqrt{n}, where m and n are integers, find m+n.