Even if this was one flight number (I don't know whether it is or not), when you are dealing with direct flights, the miles are calculated from the beginning of the direct flight until the end, no matter where it connects. For example, American has a direct flight from LAX to Brussels which connects through Chicago. To calculate miles, you would do it from LAX-BRU, not LAX-ORD-BRU.