Typically a single flight number can only accommodate 4 legs/segment one way as this is a limitation in most GDS systems. Of course a ticket buyer can combine flights to create more legs if necessary but airlines don't schedule more than 4. 4 leg flights are not common however. A leg/segment is defined as a takeoff and landing. So a 4 leg flight would be A to B to C to D one way.