A cylindrical barrel with a radius of 12 feet rests on its round side against a wall. A ladder leans against both the barrel and the wall in such a way that the top of the ladder and the base of the ladder are equidistant from the base of the wall. How long is the ladder?