1 answer
(click or scroll down)
Let X be the number of pens Jozhua bought
There were 2/5 of X pens that were red leaves 18 / (2/5) = <<18/(2/5)=45>>45 pens
There were X - 45 of the pens that were not red
There were 1/4 * (X - 45) = 18 pens that were blue
So X - 45 = 18 * 4 = <<18*4=72>>72
Thus Jozhua bought X = 72 + 45 = <<72+45=117>>117 pens. Answer: \boxed{117}.