here
thickness of the slab = real depth from one face (d) + real depth from the opposite face (d')
now, we know that
refractive index = real depth / apparent depth
thus, for the one face
1.5 = d / 5 cm
or
d = 7.5 cm
and for the opposite face
1.5 = d'/2cm
or
d' = 3 cm
so, total thickness of the slab will be
T = d + d' = 7.5cm + 3cm
or
T = 10.5 cm