At the beginning of school year in one of the first grade classes:
$i)$ every student had exatly $20$ acquaintances
$ii)$ every two students knowing each other had exactly $13$ mutual acquaintances
$iii)$ every two students not knowing each other had exactly $12$ mutual acquaintances
Find number of students in this class
1. **Define Variables and Initial Observations:**
   Let \( n \) be the number of students in the class. Each student has exactly 20 acquaintances, so the total number of pairs of acquaintances is \( 10n \). This is because each acquaintance relationship is counted twice (once for each student in the pair).

2. **Counting Common Triples:**
   A common triple \((A, B, C)\) is defined as a set of three students where \( A \) and \( B \) are acquaintances, and \( B \) and \( C \) are acquaintances. We need to count the number of such triples in two different ways.

3. **Counting from the Perspective of a Fixed Student \( B \):**
   For a fixed student \( B \), there are \( \binom{20}{2} = 190 \) ways to choose two acquaintances \( A \) and \( C \). Since there are \( n \) students, the total number of common triples is:
   \[
   190n
   \]

4. **Counting from the Perspective of Pairs \( (A, C) \):**
   We need to consider two cases: when \( A \) and \( C \) are acquaintances and when they are not.

   - **Case 1: \( A \) and \( C \) are acquaintances.**
     By condition \( ii \), there are exactly 13 possible students \( B \) who are mutual acquaintances with both \( A \) and \( C \). Since there are \( 10n \) such pairs \( (A, C) \), the total number of common triples in this case is:
     \[
     13 \times 10n = 130n
     \]

   - **Case 2: \( A \) and \( C \) are not acquaintances.**
     By condition \( iii \), there are exactly 12 possible students \( B \) who are mutual acquaintances with both \( A \) and \( C \). The number of non-acquaintance pairs \( (A, C) \) is:
     \[
     \binom{n}{2} - 10n = \frac{n(n-1)}{2} - 10n
     \]
     Simplifying this expression:
     \[
     \frac{n(n-1)}{2} - 10n = \frac{n^2 - n - 20n}{2} = \frac{n^2 - 21n}{2}
     \]
     Therefore, the total number of common triples in this case is:
     \[
     12 \times \frac{n^2 - 21n}{2} = 6(n^2 - 21n)
     \]

5. **Equating the Two Counts:**
   The total number of common triples from both perspectives should be equal:
   \[
   190n = 130n + 6(n^2 - 21n)
   \]
   Simplifying this equation:
   \[
   190n = 130n + 6n^2 - 126n
   \]
   \[
   190n = 6n^2 + 4n
   \]
   \[
   0 = 6n^2 + 4n - 190n
   \]
   \[
   0 = 6n^2 - 186n
   \]
   \[
   0 = 6n(n - 31)
   \]

6. **Solving for \( n \):**
   Since \( n \) must be positive:
   \[
   n = 31
   \]

The final answer is \( \boxed{31} \).