A polygonal line of the length $1001$ is given in a unit square. Prove that there exists a line parallel to one of the sides of the square that meets the polygonal line in at least $500$ points.
My try :
I haven't done much. I tried to take a very small part of the polygonal line of length $t$, and consider its horizontal component $x$, vertical component $y$, then I haven't done anything more from here. Any help is welcomed. Thanks a lot.