In fourth grade there were 42 students at the start of the year. During the year, 4 students left, and 10 students were transferred to fifth grade. How many students were in fourth grade at the end?