In a row of 40 students, R is fifth from the right end and there are 10 students between R and D. What is D's position from the left end of the row?