c = amount of folks buying coach tickets
s = amount fo folks buying sleeper car tickets
we know the train had a total of 96 passengers, so, whatever "c" and "s" are
c + s = 96
we know all tickets sold for all 96 passengers was 19994, so, if "c" folks rode coach, each ticket is 114, thus 114*c is how much money was from couch, or 114c
if "s" folks rode the sleeper car, we know each ticket is 295 each, so 295*s is how much money was from the sleeper car
we also know, the total for all tickets is 19994
thus 114c + 295s = 19994
thus

solve for "s", to see how many folks rode coach
what about the sleeper car? well, s = 96 - c