ok, not thay hard. we can make a variable.
say x = pieces of candy Sam has.
so Kabir has 5x
and the total is x + 5x = 6x
then we know that 5x - 18 = 3x (the 3x is from 6x/2)
\(5x-18=3x \)
\(5x=3x+18\)
\(2x=18\)
\(x=9\)
so the total is 6x, 6 * 9 = 54.