FR 5494 then FR 5713 at Madrid
Milan Bergamo → Madrid → Budapest
Timetable, Madrid time
21:40FR 5494 from Milan Bergamo at the gate
18:15FR 5713 to Budapest leaves the gate
20 h 35 apart on the timetable, overnight
FR 5713 leaves 20 h 35 after FR 5494 arrives on the timetable: more than half a day, so not a connection we count.