Each P operation decreases the value of counting semaphore by 1 and each V operation increases the value of counting semaphores by 1
Here given value of counting semaphore is 7 then 20 p operation will reduces it to -13
then in order to increase it to 5 18 V operations are needed
hence x=18 ans is A