8bits in a byte.
Mega = million.
Therefore 40mbps = 40 000 000 bits per second.
Divide by 8 gives you bytes.
Therefore 40mbps = 5 000 000 bytes per second.
Divide by 1024 gives you Kilobytes per second = 4882.8125 Kb
Divide by a further 1024 gives you Megabytes per second.
So that equals 4.76MB/s.
So to answer your question, it would take about 19 minutes to transfer 5Gb.