We can make an equation for this, if we call the number in question x, we know that first we had 5x and then 3 was taken from that to get 12
This gives us 5x - 3 = 12
We can then add 3 on both sides to get 5x = 15
Then we can divide both sides by 5 to get x = 3
So the number was 3