Given a cube $ABCDA'B'C'D'$ and S,T,R,N the middle of $AB, DD', DC,$ respectivley $BC'$. Find the cosine of the angle of $TS$ and $RN$.

I tried to use paralelism and perpendicularity theorems, then the cosinus theorem, but I didn't match very well the reslts.