Explanation:
x = number of small boxes
y = number of large boxes
these equations model the situation :
x + y = 8
12x + 45y = 195
FYI - the solution :
from the first equation we get
x = 8 - y
we use that in the second equation
12(8 - y) + 45y = 195
96 - 12y + 45y = 195
33y = 99
y = 3
x = 8 - y = 8 - 3 = 5