Solve the following math problem step by step. The last line of your response should be of the form Answer: \boxed{$Answer} where $Answer is the answer to the problem.

<image>In $\triangle ABC, \overline{BD}$ is a median. If $AD=3x+5$ and $CD=5x-1,$ find $AC$.