First MTU=65536B.it contains header size and payload size.
MTU=65536-20=65526 this is payload .(maximum data that can transmit at a time)
I)packet size=40000B it also conatins header size i.e)20B.
payload=40000-20=39980B.
At first M1 no need of fragmentation because 39980<65526.
ii)same as first one payload=1520-20=1500B.
at a time it can transmit 1496B only because packet size in the form of bytes.
39980/1496=26 fragments +1088(+4 padding bits)
At 2nd MTU no of fragments are 27.
iii) same as above payload=512-20=492B
it can transmit 488B at a time.
no of fragments=1496/488=4 fragments.
total of 26*4=104 fragments
last fragment 1088/488=3 fragments.
Hence total of 104+3=107 fragments