Let the number of magnets shared by the 3 boys==M
Pierre took ==1/4M + 6
M - [1/4M + 6]==3[M - 8]/4
Kelsey took ==[2/3 * 3[M - 8] / 4] + 2=[M - 4] / 2
1/4M + 6 + [M - 4] / 2 + 12 =M, solve for M
M==64 - Total number of magnets.
Pierre took ==1/4*64 + 6 ==22 magnets.
Kelsey took ==[64 - 4] / 2 ==30 magnets.
Titus took ==12 magnets
22 + 30 + 12 ==64 magnets shared by 3 boys.