There are 10 packets : $1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10$
Since this is GBN-7, we will send the first $7$ packets, as every $5^{th}$ packet is lost so packet number $5$ is lost .
$Number\, of\, packets\,transmitted = 7$
The acknowledgment for packet number $1$ will come, the window will slide and packet number $8$ will be send, then acknowledgment for packet $2$ will come and packet $9$ is sent, same for $3$ then $10$ will be sent, this is the $10^{th}$ packet this is lost.
$Number\, of\, packets\,transmitted = 7 + 3$
When the acknowledgment for packet number $4$ will come the window slides but we do not have any packets to transfer after $10$.
The window will not slide after packet number number $5$ as the packet number $5$ is lost.
So, we will retransmit packet number $5$ and all the packets upto $10$ as only $5$ other are available.
$Number\, of\, packets\,transmitted = 7 + 3 + 6$
The packet number $5$ is the $11^{th}$ packet to be transmitted so packet number $9$ will be the $15^{th}$ which will be lost. So, acknowledgment for packet $9$ will not come so, we will re-transmit packet number $9,\,10$
$Number\, of\, packets\,transmitted = 7 + 3 + 6 + 2 = 18$
Correct me if I'm wrong