Solution: draw a vertical line segment L from point (x, y) to (x, MIN), and then count the number of intersection of L and polygon edges.
Solution: dynamic programming.
Note: consecutive movement of the same type is forbidden, and more than one movement type to reach a specific position is possible.