Mario invested $475 in S45 and $25 stock shares. The number of $25 shares was 5 less than three times the number of people $45 shares. How many of each type of share did he buy?

number of $45 shares ---- x

number of $25 shares ---- 3x - 5

45x + 25(3x-5) = 475

solve for x, sub into my definitions