Janine bought 8 books at w pesos each and 7 pens at m pesos each. She had (3w + 5m) left. Find the amount of money she had at first.