Let the total number of students be \( N \).
- 82% of \( N \) passed in Mathematics, so \( 0.82N \) passed in Mathematics.
- 70% of \( N \) passed in Science, so \( 0.70N \) passed in Science.
- 13% failed in both, so 87% passed at least one subject:
\[ 0.87N \]
Let \( x \) be the number of students who passed in both subjects.
We are given that \( x = 299 \).
Using the principle of inclusion-exclusion:
\[
0.82N + 0.70N - 299 = 0.87N
\]
Simplifying:
\[
1.52N - 299 = 0.87N
\]
\[
1.52N - 0.87N = 299 \quad \Rightarrow \quad 0.65N = 299 \quad \Rightarrow \quad N = \frac{299}{0.65} = 460
\]
Thus, the total number of students who appeared in the examination is \( 460 \).