arrival times of boats leaving M and arriving at I :
9h45 - 10h05 - 10h25
The earliest boat to arrive is 9h45, +5min turnaround time = 9h50
This boat has arrived early enough to be used for the return ferry ride at 9h55 from I to M.
so the minimum number of boats needed are 3 boats leaving M to I (9h05 - 9h25 - 9h45) and only 2 boats leaving I to M (9h15 - 9h35) as the last journey reuses the 9h05 boat
Hope this helps!