**HINT**
Consider the Figure below and note that
1. $\overline{O_2H} = \frac{R}{2}-r$;
2. $\overline{O_2O_3} = \frac{R}{2} + r$;
3. $\overline{HO_1} = r$;
4. $\overline{O_1O_3} = R-r$;
Use Pythagorean theoerm on $\triangle O_2HO_3$ and on $\triangle O_1HO_3$ to determine $\overline{HO_3}$ in two ways and thus get an equation, which, once solved, will give you the desider result of $r$ as a function of $R$.
![enter image description here](