For an k-ary tree , where each node has k children or no children,
$L=(k-1)*I+1\; \;\; \ldots (1) $
Where L= no. of leaf nodes and $I=$ no. of internal nodes.
In the given question tree is a ternary tree having 0 or 3 children to each node.
For such type of full ternary tree every node is either a leaf or internal node.
$\implies L+I=n\implies I=n-L$
So $L=(3-1)*I+1$ (k=3)
$\Rightarrow L=2*(n-L)+1$
$\Rightarrow L=\frac{2n+1}{3}$