No. of packets sent $=\dfrac{10000}{5000}= 2$.
Time for the first packet to reach switch $=\text{Transmission time + Propagation delay}$
$= \left(\dfrac{5000}{10^7}\right)\times {10^6}\mu s+20\mu s$
$= 520\mu s.$
$($Another $520\mu s$ is required for the same packet to reach the destination from the switch and in between there is a forwarding delay of $35\mu s.$ So, first packet is received at destination at $2\times 520+ 35=1075 \mu s. )$
After $520 \mu s,$ the switch can start receiving the second packet and at $520 + 500 = 1020 \mu s,$ second frame is completely received by the switch $($we don't need to add propagation time here as packet $2$ can just follow packet $1 )$.
So, at $1055\mu s$ from the start the switch starts sending the second packet and this will be received at destination after another $520 \mu s=1575 \mu s.$ Since we added transmission time, this ensures that the last bit of data is received at the sender.
EDIT:-
(Alternate solution)
We can think the same question in terms of last packet, argument here is: The moment last packet reaches to destination, all other packets are already reached.
Total time $=\text{Transmission time of all packets + Propagation time for first link}$
$\text{+ Switch Delay + Transmission time of last packet for Switch}$
$\text{+ propagation time for 2nd link}.$
$=\left (\dfrac{10^4}{10^7}\;\text{sec} = 1\;\text{ms} = 1000\mu s \right) 1000 + 20 + 35 + 500 + 20=1575\mu s.$