Suppose we have a set $S=\{1,2,3,x,y\}$. There are $5!$ ways to rearrange the elements in the set, but I am confused about how to find the number of ways to rearrange the set given that $3$ comes before $2$ which comes before $1$ (or something like that). For instance, we could write
$$\{3,2,1,x,y\}\\ \{3,2,x,1,y\}\\ \{3,2,x,y,1\} \ \text{etc}...$$
It is easy to do by a brute force method, consisting of writing down all the possible sets, but is there a short, mathematical, way to do so?