Let \( x \) represent the number of students taking only Mathematics, and \( y \) represent the number of students taking only Chemistry.
From the Venn diagram:
- The total number of students in Mathematics is \( x + 30 \).
- The total number of students in Chemistry is \( y + 30 \).
Given conditions:
\[
30 = \frac{10}{100} (x + 30)
\]
Solving for \( x \):
\[
x + 30 = \frac{30 \times 100}{10} = 300
\]
\[
x = 270
\]
Similarly, for Chemistry:
\[
30 = \frac{12}{100} (y + 30)
\]
Solving for \( y \):
\[
y + 30 = \frac{30 \times 100}{12} = 250
\]
\[
y = 220
\]
Using the formula for the union of two sets:
\[
|M \cup C| = |M| + |C| - |M \cap C|
\]
Substituting values:
The total number of students is \( x + y + 30 \), which equals \( 270 + 220 + 30 = 520 \).
Thus, the final answer is:
\[
\boxed{520}
\]