1. Given the set $S=\{1,2, \cdots, 3 n\}, n$ is a positive integer, $T$ is a subset of $S$, satisfying: for any $x, y, z \in T$ (where $x, y, z$ can be the same), we have $x+y+z \notin T$. Find the maximum number of elements in all such sets $T$.