An urn contains three red balls and n white balls. Mr. A draws two balls together from the urn. The probability that they have the same color is `1//2.` Mr.B draws one ball from the urn, notes its color and rplaces it. He then draws a second ball from the urn and finds that both balls have the same color is `5//8.` The value of n is ____.
A. 9
B. 6
C. 5
D. 1