Find the percentage who failed both exams, then work back to the total.

\\(\begin{aligned}
\text{Failed first exam} &= 35\% \text{ of total}
\\
\text{Of those, 80\% pass retest} &: 0.35 \times 0.80 = 0.28 = 28\% \text{ pass retest}
\\
\text{20\% of first-fail fail retest} &: 0.35 \times 0.20 = 0.07 = 7\% \text{ fail both}
\\
\text{Overall pass} &= 65\% + 28\% = 93\% \; \checkmark
\\
7\% &\rightarrow 28 \text{ students}
\\
\text{Total} &= 28 \div 0.07 = 400
\end{aligned}\\)

Final Answer: 400