interesting puzzle,
total CDs=
country CDs $c$ is half of rock CDs $r$, $r=2c$
and one fourth of soundtrack $s$ as country CDs , $c=4s$
express in common variable s, $r+c+s=39$
$2(4s)+4s+s=39 \implies s=3$
so $c=12$ and $r=24$
after borrowing 3 rock CDs, there be $21$ rock CDs rest will be same