Martin has a variety of cookies. 2/3 of the cookies were gingerbread. 1/4 of the remaining cookies were sugar. There were 6 chocolate chip cookies. How many cookies did Martin have altogether?

Total number of cookies ---- x

number of gingerbread = (2/3)x = 2x/3
sugar cookies = (1/4)(1/3)x = x/12
chocolates --- 6
assuming there were no other kind

2x/3 + x/12 + 6 = x
times 12
8x + x + 72 = 12x
3x = 72
x = 24 <------ total number of cookies

check:
gingers = (2/3)(24) = 16 , leaving 8
sugars = (1/4)(8) = 2
chocs = 6
16 + 2 + 6 = 24 , all is good