The roots of the polynomial $f(x) = x^8 + x^7 - x^5 - x^4 - x^3 + x + 1$ are all roots of unity. We say that a real number $r \in [0, 1)$ is nice if $e^{2i \pi r} = \cos 2\pi r + i \sin 2\pi r$ is a root of the polynomial $f$ and if $e^{2i \pi r}$ has a positive imaginary part. Let $S$ be the sum of the values of nice real numbers $r$. If $S = \frac{p}{q}$ for relatively prime positive integers $p, q$, find $p + q$.

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