Answer is 13 .
Interesting question
Here Semaphore is Binary ( Main thing to note )
So if S=0 and if down or P or wait is performed on S it will remain 0 irrespective of the count of down performed in continous order
and if S=1 and if up or V or signal is perforned on S it will remain 1 irrespective of the count of UP performed in continous order
So , here s=0 intitally
1) 4p i.e 4 down on S , s will remain 0 but 4 process will get blocked
2) 6v i.e 6 up on S , s will raise to 1 and all 4 process will get unblock and will execute
3) 9p i.e 9 down on S, s will decement to 0 after 1 down and rest 8 down will cause 8 process to get blocked
4)13 V i.e 13 up on S , s will increment to 1 and will unblock all the 8 processes
5) 14P i.e 14 down on S , it will decrement S to 0 after 1 down and rest all 13 down will cause 13 processes to get blocked.