The number $5374$ is $5000+300+70+4$
What does this become once the $5$ has moved to the back of the queue?
How many 5s, 3s, 7s and 4s are there when you combine the two numbers?