Answer :

she had 45 pens in total. if you multiply 8 by 3 you get 24. so you multiply 7 by 3 and get 21. then just add 21 and 24 to get 45.
Ratio of red to blue is 8:7 . . . but she has 24 red pens . . . not 7, so the ratio leaves us to figure out how many blue pens . . . x . . . at a ratio of 24:x . . . we know that whether she has 24 or 7 or any number of red pens, we know the ratio will always be the same . . . so 24/x = 8/7 . . . solve by multiplying x to both sides and then multiplying both sides by 7/8/. . . 24*7/8 . . . x = 21 blue pens. 21 + 24 = 45 pens total.