If you have a graph whose vertices are labeled 1, 2, ..., n for some natural number n, its adjacency matrix is the n x n matrix whose (i, j) entry is 1 if ij is an edge of the graph and 0 otherwise. For us, the diagonal entries will all be 0 because edges must always connect two different vertices.
Draw a diagram of the graph whose adjacency matrix is given above on the left. Write the adjacency matrix of the graph whose diagram is given above on the right. If you took the graph in the problem, found its adjacency matrix, and then added up all the entries of the matrix, what would you get?
(You can solve this problem by writing out an 8 x 8 matrix and adding up 64 entries, but there's an easier way.)