calculate number of routes contstraining stops