At a strange party, each person knew exactly $22$ others.
For any pair of people $X$ and $Y$ who knew each other, there was no other person at the party that they both knew.
For any pair of people $X$ and $Y$ who did not know one another, there were exactly 6 other people that they both knew.
How many people were at the party?
1. **Define the problem and variables:**
   Let \( n \) be the number of people at the party. Each person knows exactly 22 others. For any pair of people \( X \) and \( Y \) who know each other, there is no other person at the party that they both know. For any pair of people \( X \) and \( Y \) who do not know each other, there are exactly 6 other people that they both know.

2. **Count the number of ordered triplets \((A_i, A_j, A_k)\) where \( A_i \) knows both \( A_j \) and \( A_k \):**
   - Fix \( A_i \). Since \( A_i \) knows exactly 22 others, we can choose \( A_j \) and \( A_k \) from these 22 people. The number of ways to choose \( A_j \) and \( A_k \) is \( \binom{22}{2} = 22 \cdot 21 / 2 \). Since \( A_i \) can be any of the \( n \) people, the total number of such triplets is:
     \[
     n \cdot 22 \cdot 21
     \]

3. **Count the number of ordered triplets \((A_i, A_j, A_k)\) by fixing \( A_j \):**
   - Fix \( A_j \). For each \( A_j \), there are \( n-1 \) other people. Since \( A_i \) knows both \( A_j \) and \( A_k \), \( A_j \) and \( A_k \) do not know each other. By hypothesis, for each pair of people who do not know each other, there are exactly 6 other people that they both know. Therefore, the number of such triplets is:
     \[
     n \cdot (n-23) \cdot 6
     \]

4. **Equate the two expressions for the number of triplets:**
   \[
   n \cdot 22 \cdot 21 = 6n(n-23)
   \]

5. **Simplify the equation:**
   \[
   22 \cdot 21 = 6(n-23)
   \]
   \[
   462 = 6(n-23)
   \]
   \[
   462 = 6n - 138
   \]
   \[
   600 = 6n
   \]
   \[
   n = 100
   \]

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