The river

We want to link the two houses A and B to the pump P, using as few pipes as possible.

 

Move the point P so as to find this minimal value in metres, knowing that 1 cm on the diagram represents 10 m.