X = total boats
2/3x are white....so the remaining boats = 1/3x
5/8 of the remaining boats are blue.....5/8 * 1/3 = 5/24x are blue
2/3 + 5/24 = 16/24 + 5/24 = 21/24 are blue and white......so 3/24 are red
3/24x = 6
x = 6 * 24/3
x = 144/3
x = 48 total boats in the marina <==
2/3(48) = 32 white
5/24(48) = 10 blue
3/24(48) = 6 red
2*4=8
2*d=2d
3*2=6
3*d=3d
Then collect like terms
8-2d=6+3d
2+5d