Each person shakes hands with nine other people, so you count 9 handshakes for the first person. But you only count 8 handshakes for the second person because one of his/her handshakes was with the first person and has already been counted. You count seven for the third person because two of her/his handshakes have already been counted. So the total handshakes can be added together
9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 = 45