Let the width of the square wall be L=10 m and height of each layer be h=5 m.
Average pressure on the upper part MN: Pavg1=20+ρ1gh=21ρ1gh
Hydrostatic force on the upper part MN: FMN=Pavg1×(L×h)=21ρ1gh2L
Pressure at depth h (interface point N) and depth 2h (bottom point O): PN=ρ1gh,PO=ρ1gh+ρ2gh
Average pressure on the lower part NO: Pavg2=2PN+PO=2ρ1gh+(ρ1gh+ρ2gh)=ρ1gh+21ρ2gh
Pavg2=ρ1gh+21(2ρ1)gh=2ρ1gh
Hydrostatic force on the lower part NO: FNO=Pavg2×(L×h)=2ρ1gh2L
FNOFMN=2ρ1gh2L21ρ1gh2L=41