In an examination of $n$ questions, a student replied 15 out of the first 20 questions correctly. Of the remaining questions, he answered one-third correctly. All the questions have the same credit. If the student gets 50\% marks, the value of $n$ is