after returning 5 dollars, the cow costs 25 dollars..means each guy now has to contribute
25/3=8.333333333333333333333333333333
subtract this amount from 10 dollars to get the excess amount which each one of them has paid:
10 - 8.333333333333333333333333333333=
1.666666666666666666666666666667
as each one of them gets 1 dollar back so the excess amount paid by them becomes:
0.666666666666666666666666666667
now multiply this amount with 3 and you'll get the 2 dollars which the farmer's son has pocketed
0.666666666666666666666666666667 x 3=2