The question is the following:
Construct a CFG for $L_2 = \{w \in \{0, 1\}^* \mid w = w^R\text{ and the number of 1’s in $w$ is divisible by 3}\}$.
I can construct a CFG for $\{w \in \{0,1\}^* \mid w = w^R\}$ as follows
$$S → 1S1\mid 0S0\mid 0\mid 1\mid \epsilon$$
I don't understand how to make $w$ divisible by 3 in my CFG.