Sample covariance

Hi guys,
Kaplan book 2 p.16 example question
Why isen’t it 6-1? The total n is 6 in the sample… I don’t understand why we use 3. Can someone please explain?