We can use the pigeonhole principle to solve this problem.
We need to have 1 more than the maximum number of possible grades.
That way, we can guarantee that if all students receive different grades, the last student will receive a duplicate grade.
There are 5 possible grades: $ A, B, C, D, F $
Thus, the minimum value for $ n $ is $ 5 \cdot 3 + 1 $
Thus, the minimum value for $ n $ is 16.