The maximum number of waypoints that are allowed to be uploaded to the aircraft is 99. To follow the terrain we optimize the flight path to allow for +-5% of the flight altitude. This allows us to use less waypoints to cover further distances without always having to come back to load more waypoints. It is certainly possible to chew through waypoints quickly on really rugged terrain.
Aligning your passes so they go across a hillside is going to take a lot less waypoints than going up and down the hillside is.
You can see where the waypoints are placed in the plot.
The higher you fly the more that +-5% is going to get you in terms of tolerance.