We use the Linearity of Expectations. For $i\in \\{1,\cdots,17\\}$ let $X_i$ be the indicator variable telling you whether Cage $i$ contains the same animal as Cage $i+1$ (thus $X_i=1$ if the two animals match, and $0$ otherwise). Then $E[X_i]=\frac 5{17}$ and the answer you want is $$E=E\left[\sum X_i\right]=\sum E[X_i]=17\times \frac 5{17}=5$$