there are 12 friends. each greeted each other by shaking hands. how many handshakes took place.
There are 12 friends and each shakes hands with each of the 11 others. The "principle of counting" says there are 12*11 "handshakes". But that counts the handshake between "Andy" and "Barbara" twice- once for Andy and once for Barbara. So, as BAdhi says, divide by 2.