Overall the total length of walls equalled 25700 meters , and formed a roughly square layout (although the southern and northern walls had sections which zigzagged due to topographical concerns: rough terrain existed along the southern wall and the course of the Wei River obstructed the straight path of the northern wall).