If you know the total and how many less/more of one over the other, you just need to assign variables to each.
Let h = hamburgers; c = cheeseburgers
c + h = 496
c = h - 54
h + (h - 54) = 496
2h = 550
h = 275
c = 275 - 54
c - 221
Verify: 275 + 221 = 496