Traditionally, the eastern terminus of the wall was considered to be Shanhai Pass (Shanhaiguan) on the coast of the Bohai (Gulf of Zhili), and the wall's length—without its branches and other secondary sections—was thought to extend for some 4160 miles .