Compute the number of nonempty subsets $S$ of the set $\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\}$ such that $\frac{\max S + \min S}{2}$ is an element of $S$.

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