The length of Cube P is the length of Cube Q. The volume of Cube Q is 512 . Find the total volume of the two cubes.