Counting handshakes is a fairly classic problem. A video explaining it is at [url]http://www.artofproblemsolving.com/Videos/external.php?video_id=60[/url]. Here is a relay version of this problem. A non-relay version of the problem is available at [url]http://www.geogebratube.org/student/b138355#material/142499[/url]