The given information is as follows:
- 5 persons between A and B.
- 8 persons between B and C.
- 3 persons ahead of C.
- 21 persons behind A.
The positions of A, B, and C must be arranged in the following way:
- A has 3 people ahead and 21 behind, which means A is in position 4.
- B is 5 persons away from A, so B is in position 10.
- C is 8 persons away from B, so C is in position 19.
Therefore, the total number of persons in the queue is:
\[
\text{Total} = \text{Position of C} + \text{Persons behind C} = 19 + 9 = 28
\]
Thus, the minimum number of persons in the queue is \( \boxed{28} \).