Since 5 process request 3 instances each, total remaining instances will be 27-15=12.
max value of n such that each of n has 4 instances is:
3n+1<=12 (each of n processes assigned with 3 instances(as max requirement is 4) and at least 1 instance should be left out to avoid deadlock)
n<=3.66
max value of n can be 3.