In the opening ceremony of the 2014 FIFA World Cup Brazil, all football teams who participates gathered together. The team captain of each team was handshaking with one another to promote their new act for world peace which was called "A Handshake for Peace!". Each team captain is as polite as the other. How many teams are there if there were a total of 595 handshakes?