FR 5322 then AV 6518 at Madrid
Milan → Madrid → Frankfurt am Main
Timetable, Madrid time
19:45FR 5322 from Milan at the gate
13:20AV 6518 to Frankfurt am Main leaves the gate
17 h 35 apart on the timetable, overnight
AV 6518 leaves 17 h 35 after FR 5322 arrives on the timetable: more than half a day, so not a connection we count.