What is the sum of all positive integer values of $n$ that satisfy the equation:
\[
  \cos \left( \frac{\pi}{n} \right) \cos \left( \frac{2\pi}{n} \right) \cos \left( \frac{4\pi}{n} \right) \cos \left( \frac{8\pi}{n} \right) \cos \left( \frac{16\pi}{n} \right) = \frac{1}{32}?
\]

Let's think step by step and output the final answer within \boxed{}.
user