Stop and Wait are easy to calculate- a resent happens only for the lost packet.
After 4 sends, we have a loss.
So, packet 4 lost, resent.
Packet 7 lost (since 4 was resent), resent.
So, totally 2 packets needs to be resent out of 8- 10 packets needs to be sent.
ACK won't be counted as packets as they are usually very very small.