The language generated by the grammar is : $w(a+b+\varepsilon)w^{r}, |w|>=0, w\,\epsilon\,(a,b)$
For $0\,and\,1$ length string : $|w|=0$, strings = $a,b,\varepsilon$
For $2$ length strings, the strings are : $w(\varepsilon)w^{r}, |w|=1$
For $3$ length strings, the strings are : $w(a+b)w^{r}, |w|=1$
For $4$ length strings, the strings are : $w(\varepsilon)w^{r}, |w|=2$
For $5$ length strings, the strings are : $w(a+b)w^{r}, |w|=2$
For $6$ length strings, the strings are : $w(a+b)w^{r}, |w|=3$
Total = $3+2^{1}+2^{1}*2+2^{2}+2^{2}*2+2^{3}=29$