how many 12 x 12 x 6 boxes can fit into a 22 x 22 x 22 box

You need to map out what orientation the boxes would have. Three 12x12x6 boxes would fit one way, leaving 4x22x22 units (whatever units you are using) in one direction and 10x22x22 in another. This means you could slip in one more 12x12x6 box perpendicular to the other three.