4. Let $S=\left\{r_{1}, r_{2}, \cdots, r_{n}\right\} \subseteq\{1,2,3, \cdots, 50\}$, and any two numbers in $S$ cannot have a sum that is divisible by 7, then the maximum value of $n$ is $\qquad$
$23 ;$