$12 n$ is a positive integer, $S_{n}=\left\{\left(a_{1}, a_{2}, \cdots, a_{2^{n}}\right) \mid a_{i}=0\right.$ or 1 , $\left.1 \leqslant i \leqslant 2^{n}\right\}$, for any two elements $a=\left(a_{1}, a_{2}, \cdots, a_{2^{n}}\right)$ and $b=\left(b_{1}, b_{2}, \cdots, b_{2^{n}}\right)$ in $S_{n}$, let
$$
d(a, b)=\sum_{i=1}^{2^{n}}\left|a_{i}-b_{i}\right| \text {. }
$$

If $A \subseteq S_{n}$, such that for any two different elements $a, b$ in $A$, there is $d(a, b) \geqslant 2^{n-1}$, then $A$ is called a good subset. Find the maximum number of elements in a good subset of $S_{n}$.