This is the "handshake problem", namely with n people, how many handshakes will there be if every will shake hands with everyone else. n people will shake hands with (n-1) other people. Since we are counting twice for each handshake, the number of handshakes is n(n-1)/2. For n=5, the number of matches is 5(5-1)/2=10. This is also the number of diagonals in an n-sided convex polygon.