Metal-insulator transition in a multilayer system with a strong magnetic field