8, 7, 6, 5, 4, 3, 2, 1, and 0.
1) No one will shake hands with themself or their spouse so I can put a X in each of those pairs
2) Now, let AH be the one that shakes 8 hands
3) Now all have shaken AH hand axcept for his wife so his wife must be the only one to shake no hands
4) Let BH be the one to shake 7 hands
5) now all have shaken 2 hands already except for BW so she must be the one to shake just one hand
6) Let CH be the one to shake 6 hands
7) Now they have all shaken 3 hands except for CW so she must be the one to shake only 2 hands.
8)Let DH be the one to shake 5 hands
9) which means that D wife shakes 3 hands
Which now leaves E husband and E wife to shake 4 hands each.
That is, John and his wife shake 4 hands each :)
AH | AW(3) | BH(4) | BW(5) | CH(6) | CW(7) | DH(8) | DW(9) | EH | EW | count | |
AH | X | X | y | y | y | y | y | y | y | y | 8 |
AW(3) | X | X | X | X | X | X | X | X | X | X | 0 |
BH(4) | y | X | X | X | y | y | y | y | y | y | 7 |
BW(5) | y | X | X | X | X | X | X | X | X | X | 1 |
CH(6) | y | X | y | X | X | X | Y | Y | Y | Y | 6 |
CW(7) | y | X | y | X | X | X | x | x | x | x | 2 |
DH(8) | y | X | y | X | Y | x | X | X | y | y | 5 |
DW(9) | y | X | y | X | Y | x | X | X | x | x | 3 |
EH | y | X | y | X | Y | x | y | x | X | X | 4 |
EW | y | X | y | X | Y | x | y | x | X | X | 4 |
count | 8 | 0 | 7 | 1 | 6 | 2 | 5 | 3 | 4 | 4 |