I have a pouch with pens and pencils in it. At the end of math class, the ratio of pens to pencils is 9:7. While walking from math class to photography class, I found three pens and one pencil. After I put them in my pouch, the ratio of pens to pencils was 7:5. How many pencils did I have at that point?

If there were x pencils and y pens, then

x/y = 9/7
(x+3)/(y+1) = 7/5
Now solve for y