we take succesive images of every image on its opposite mirror till the image finally ends to the other side of the opposite mirror...
u should end up getting a arithmetic series for the angle for the image formed first 1 and i.this angle should not exceed 180 degree as the image will go behind the mirror..then the total no will be added for both to get the formula.