Step 1: Assume the initial numbers of students.
Let the number of students in the three classes initially be
\[
3x,\; 13x,\; 6x.
\]
Step 2: Add 18 students to each class.
After adding 18 students to each class, the numbers become
\[
3x+18,\; 13x+18,\; 6x+18.
\]
Step 3: Use the new ratio.
According to the question,
\[
\frac{3x+18}{15} = \frac{13x+18}{35} = \frac{6x+18}{21}.
\]
Step 4: Solve using the first two terms.
\[
\frac{3x+18}{15} = \frac{13x+18}{35}
\]
\[
35(3x+18) = 15(13x+18)
\]
\[
105x + 630 = 195x + 270
\]
\[
360 = 90x $\Rightarrow$ x = 4.
\]
Step 5: Find the total number of students initially.
\[
3x + 13x + 6x = 22x = 22 \times 4 = 88.
\]
% Final Answer
Final Answer: \[ \boxed{88} \]
The value of the determinant 
is: