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



Let's think step by step and output the final answer within \boxed{}.
user