Answer is - 9
B and C at any time require maximum 8 resources. So, for deadlock to happen, only 6 resources must be allocated to B and C together. (If 7 is allocated either B or C can continue execution). Since A has peak demand of 3, in worst case for deadlock, it must be allocated 2 resources. So, maximum no. of resources that can be allocated during deadlock is 6 + 2 = 8. With 1 extra resource deadlock won't happen and hence answer is 9.