At first, the magazines in a library were placed on 32 shelves with an equal number of magazines on each shelf. 4 shelves were removed and the books on these shelves were placed on the remaining shelves. Because of this, the number of magazines on each remaining shelf increased by 10. What was the number of magazines on each shelf at first?