Sam ranked ninth from the top and thirty -eight from the bottom in a class. How many student are there in the class?