Let me get you started on this one with the equations.
You have 2 unknowns, so you will need to define 2 variables.
Let x = the number of small frames
Let y = the number of large frames
Since you have 2 variables, you have to have 2 equations to solve the problem
Equation 1: The number of frames totals 27
Equation 2: The cost of the frames is 261
Solve the first equation for y
Plug this into the second equation
Now there is one equation one unknown. Can you solve for x? This will be the number of small frames.