Let $S$ be a subset of the natural numbers such that $0 \in S$, and for all $n \in \mathbb{N}$, if $n$ is in $S$, then both $2n+1$ and $3n+2$ are in $S$. What is the smallest number of elements $S$ can have in the range $\{0,1,\ldots, 2019\}$?

Let's think step by step and output the final answer within \boxed{}.
user