There were 21 students in Travis's fourth-grade class at the end of the year. During the year four new students joined his class, and two moved away. One student was transferred to another fourth-grade teacher. How many students were there in the beginning of the year?