A finite set $\mathcal{S}$ of distinct real numbers has the following properties: the mean of $\mathcal{S}\cup\{1\}$ is 13 less than the mean of $\mathcal{S}$, and the mean of $\mathcal{S}\cup\{2001\}$ is 27 more than the mean of $\mathcal{S}.$  Find the mean of $\mathcal{S}.$
1. Let \( s \) be the sum of the members of the set \( \mathcal{S} \), and let \( n \) be the number of members in \( \mathcal{S} \). The mean of \( \mathcal{S} \) is then \( \frac{s}{n} \).

2. When we add 1 to the set \( \mathcal{S} \), the new set is \( \mathcal{S} \cup \{1\} \). The mean of this new set is given by:
   \[
   \frac{s + 1}{n + 1}
   \]
   According to the problem, this mean is 13 less than the mean of \( \mathcal{S} \):
   \[
   \frac{s + 1}{n + 1} = \frac{s}{n} - 13
   \]

3. Similarly, when we add 2001 to the set \( \mathcal{S} \), the new set is \( \mathcal{S} \cup \{2001\} \). The mean of this new set is given by:
   \[
   \frac{s + 2001}{n + 1}
   \]
   According to the problem, this mean is 27 more than the mean of \( \mathcal{S} \):
   \[
   \frac{s + 2001}{n + 1} = \frac{s}{n} + 27
   \]

4. We now have two equations:
   \[
   \frac{s + 1}{n + 1} = \frac{s}{n} - 13
   \]
   \[
   \frac{s + 2001}{n + 1} = \frac{s}{n} + 27
   \]

5. Multiply both sides of the first equation by \( n(n + 1) \):
   \[
   n(s + 1) = s(n + 1) - 13n(n + 1)
   \]
   Simplify:
   \[
   ns + n = sn + s - 13n^2 - 13n
   \]
   \[
   n = s - 13n^2 - 13n
   \]
   \[
   s = 13n^2 + 14n
   \]

6. Multiply both sides of the second equation by \( n(n + 1) \):
   \[
   n(s + 2001) = s(n + 1) + 27n(n + 1)
   \]
   Simplify:
   \[
   ns + 2001n = sn + s + 27n^2 + 27n
   \]
   \[
   2001n = s + 27n^2 + 27n
   \]
   \[
   s = 2001n - 27n^2 - 27n
   \]

7. Set the two expressions for \( s \) equal to each other:
   \[
   13n^2 + 14n = 2001n - 27n^2 - 27n
   \]
   Simplify:
   \[
   40n^2 + 41n = 2001n
   \]
   \[
   40n^2 + 41n - 2001n = 0
   \]
   \[
   40n^2 - 1960n = 0
   \]
   Factor out \( n \):
   \[
   n(40n - 1960) = 0
   \]
   \[
   n = 0 \quad \text{or} \quad 40n = 1960
   \]
   \[
   n = 49
   \]

8. Substitute \( n = 49 \) back into the expression for \( s \):
   \[
   s = 13n^2 + 14n
   \]
   \[
   s = 13(49)^2 + 14(49)
   \]
   \[
   s = 13 \cdot 2401 + 686
   \]
   \[
   s = 31213 + 686
   \]
   \[
   s = 31849
   \]

9. The mean of \( \mathcal{S} \) is:
   \[
   \frac{s}{n} = \frac{31849}{49} = 651
   \]

The final answer is \(\boxed{651}\)