Here is a diagram explaining this problem. Essentially, the circles represent students. A and B represent Alice and Bob. We can see that there are 4 students between Alice and Bob. Thus, if there are 12 students shorter than Alice, $12 - 5$ (the students marked on the diagram), means that there should be $7$ students shorter than Bob. Similarly, $14-5$ means there should be $9$ students taller than Alice.
Adding everything up gives us an answer of $7+6+9 = \boxed{22}$
Here is a diagram explaining this problem. Essentially, the circles represent students. A and B represent Alice and Bob. We can see that there are 4 students between Alice and Bob. Thus, if there are 12 students shorter than Alice, $12 - 5$ (the students marked on the diagram), means that there should be $7$ students shorter than Bob. Similarly, $14-5$ means there should be $9$ students taller than Alice.
Adding everything up gives us an answer of $7+6+9 = \boxed{22}$