Three persons A, B, C can be arranged in a queue in six different ways i.e., ABC, CBA, BAC, CAB, BCA, ACB. But since there are only 3 persons ahead of C, so C should be in front of the queue. Thus, there are only two possible arrangements i.e., CBA and CAB. We may consider the two cases as under
3 8 5 21
Case I : ←←.
Now, 28 < 40. So, 28 is the minimum number of perosn in the queue.