I'll try .....
12 players total
each shakes hands with 8 players (total of two other teams) x 3 times 12 x 8 x 3
each of the 12 shakes hands (once) with 3 of their teammates...... 12 x 3 x 1
each handshake involves two people so divide by 2
(12 x 8 x 3 + 12 x 3 x 1 ) / 2 = 162 handshakes (I think!)
(corrected)