3. We denote the natural numbers with one of the numbers 0, 1, or 2, according to the following rule: If the number $n$ is marked with $j \in \{0,1,2\}$, then the number $n+j$ is marked with 0. Let $S$ be the sum of the numbers with which the first 2023 natural numbers are marked. Determine the maximum possible value of $S$.
Solution. Let there be a given arbitrary numbering scheme according to the marking rule given in the problem statement. Let $k$ be the number of elements from the set $\{1,2, \ldots, 2023\}$ marked with $2$, $l$ be the number of elements from $\{1,2, \ldots, 2023\}$ marked with 1, and $m$ be the number of elements from $\{1,2, \ldots, 2023\}$ marked with 0. Then $S=2 k+l$. According to the problem statement, for every $i \in\{1,2, \ldots, 2023\}$ marked with 2, the number $i+2$ is marked with 0. Therefore, the number of numbers less than 2021 and marked with 2 must be less than or equal to $m$. Taking into account the last two numbers 2022 and 2023, we conclude that $k \leq m+2$. According to this,

$$
S=2 k+l=k+k+l \leq k+(m+2)+l=2023+2=2025.
$$

However, in the marking

$$
210 \text { | } 210 \text { | } 210 \text { | } \underbrace{2200|2200| \ldots}_{503 \text { blocks } 2200}|2200| 22
$$

we have $S=3 \cdot 3+4 \cdot 503+2 \cdot 2=2025$, so since $S \leq 2025$, we conclude that 2025 is the maximum possible value of $S$.