We are given an infinite sequence of $ 1$'s and $ 2$'s with the following properties: 

(1) The first element of the sequence is $ 1$. 

(2) There are no two consecutive $ 2$'s or three consecutive $ 1$'s. 

(3) If we replace consecutive $ 1$'s by a single $ 2$, leave the single $ 1$'s alone, and delete the original $ 2$'s, then we recover the original sequence. 

How many $ 2$'s are there among the first $ n$ elements of the sequence? 

[i]P. P. Palfy[/i]
To solve this problem, we need to analyze the given sequence and use the properties provided to determine the number of $2$'s among the first $n$ elements. Let's break down the solution step-by-step.

1. **Understanding the Sequence Properties:**
   - The first element of the sequence is $1$.
   - There are no two consecutive $2$'s.
   - There are no three consecutive $1$'s.
   - If we replace consecutive $1$'s by a single $2$, leave the single $1$'s alone, and delete the original $2$'s, we recover the original sequence.

2. **Sequence Construction:**
   - Let's denote the sequence by $a_n$.
   - The sequence starts with $1$, so $a_1 = 1$.
   - To avoid two consecutive $2$'s, every $2$ must be followed by a $1$.
   - To avoid three consecutive $1$'s, after two $1$'s, there must be a $2$.

3. **Pattern Recognition:**
   - The sequence can be constructed as follows: $1, 1, 2, 1, 2, 1, 1, 2, 1, 2, \ldots$
   - This sequence can be described by the recurrence relation: $a_{n+1} = 1$ if $a_n = 2$ or if $a_n = 1$ and $a_{n-1} = 2$; otherwise, $a_{n+1} = 2$.

4. **Using the OEIS Sequence:**
   - According to the OEIS sequence A189572, the number of $2$'s among the first $n$ elements is given by the formula:
     \[
     a(n) = \lfloor \alpha n + \beta \rfloor - \lfloor \alpha (n-1) + \beta \rfloor
     \]
     where $\alpha = \sqrt{2} - 1$ and $\beta = 1 - \frac{\sqrt{2}}{2}$.

5. **Calculating the Number of $2$'s:**
   - The number of $2$'s among the first $n$ elements is given by:
     \[
     \lfloor \alpha n + \beta \rfloor
     \]
     where $\alpha = \sqrt{2} - 1$ and $\beta = 1 - \frac{\sqrt{2}}{2}$.

6. **Verification:**
   - Let's verify the formula for small values of $n$:
     - For $n = 1$: $\lfloor (\sqrt{2} - 1) \cdot 1 + 1 - \frac{\sqrt{2}}{2} \rfloor = \lfloor 0.414 \rfloor = 0$
     - For $n = 2$: $\lfloor (\sqrt{2} - 1) \cdot 2 + 1 - \frac{\sqrt{2}}{2} \rfloor = \lfloor 1.828 \rfloor = 1$
     - For $n = 3$: $\lfloor (\sqrt{2} - 1) \cdot 3 + 1 - \frac{\sqrt{2}}{2} \rfloor = \lfloor 2.242 \rfloor = 2$

Thus, the number of $2$'s among the first $n$ elements is given by:
\[
\boxed{\lfloor (\sqrt{2} - 1) n + 1 - \frac{\sqrt{2}}{2} \rfloor}
\]