Joseph had 100 pencils and pens. After giving away 3/4 of his pencils and 15 pens he had equal number of pencils and pens left. How many pens did he have at first?

If he started with x pencils and y pens, then

x+y = 100
1/4 x = y-15

since x = 100-y,
1/4 (100-y) = y-15
25 - 1/4 y = y-15
40 = 5/4 y
y = 32
so, 32 pens and 68 pencils