Let $S_n = n^2 + 20n + 12$, $n$ a positive integer. What is the sum of all possible values of $n$ for which $S_n$ is a perfect square?
1. We start with the given expression for \( S_n \):
   \[
   S_n = n^2 + 20n + 12
   \]
   We need to find the values of \( n \) for which \( S_n \) is a perfect square.

2. Let's rewrite \( S_n \) in a form that makes it easier to work with:
   \[
   S_n = n^2 + 20n + 12 = (n + 10)^2 - 88
   \]
   Let \( k^2 \) be the perfect square such that:
   \[
   (n + 10)^2 - 88 = k^2
   \]

3. Rearrange the equation to isolate the difference of squares:
   \[
   (n + 10)^2 - k^2 = 88
   \]
   This can be factored using the difference of squares formula:
   \[
   (n + 10 - k)(n + 10 + k) = 88
   \]

4. Let \( y = n + 10 \). Then the equation becomes:
   \[
   (y - k)(y + k) = 88
   \]
   We need to find pairs \((y - k)\) and \((y + k)\) that multiply to 88.

5. The factor pairs of 88 are:
   \[
   (1, 88), (2, 44), (4, 22), (8, 11)
   \]

6. For each factor pair, we solve for \( y \) and \( k \):
   - For the pair \((1, 88)\):
     \[
     y - k = 1 \quad \text{and} \quad y + k = 88
     \]
     Adding these equations:
     \[
     2y = 89 \implies y = 44.5 \quad (\text{not an integer, discard})
     \]

   - For the pair \((2, 44)\):
     \[
     y - k = 2 \quad \text{and} \quad y + k = 44
     \]
     Adding these equations:
     \[
     2y = 46 \implies y = 23
     \]
     Subtracting these equations:
     \[
     2k = 42 \implies k = 21
     \]

   - For the pair \((4, 22)\):
     \[
     y - k = 4 \quad \text{and} \quad y + k = 22
     \]
     Adding these equations:
     \[
     2y = 26 \implies y = 13
     \]
     Subtracting these equations:
     \[
     2k = 18 \implies k = 9
     \]

   - For the pair \((8, 11)\):
     \[
     y - k = 8 \quad \text{and} \quad y + k = 11
     \]
     Adding these equations:
     \[
     2y = 19 \implies y = 9.5 \quad (\text{not an integer, discard})
     \]

7. We have found the valid integer solutions for \( y \):
   \[
   y = 23 \quad \text{or} \quad y = 13
   \]

8. Recall that \( y = n + 10 \), so:
   \[
   n + 10 = 23 \implies n = 13
   \]
   \[
   n + 10 = 13 \implies n = 3
   \]

9. The sum of all possible values of \( n \) is:
   \[
   13 + 3 = 16
   \]

The final answer is \(\boxed{16}\).