The wall of a building is to be braced by a beam that must pass over a parallel fence 5 feet high and 4 feet from the building. Find the length of the shortest beam that can be used.

So far, I have drawn a diagram and I can see that this involves similar triangles, but I don't know how to precede from here.