A mathematical contest had $3$ problems, each of which was given a score between $0$ and $7$ ($0$ and $7$ included). It is known that, for any two contestants, there exists at most one problem in which they have obtained the same score (for example, there are no two contestants whose ordered scores are $7,1,2$ and $7,1,5$, but there might be two contestants whose ordered scores are $7,1,2$ and $7,2,1$). Find the maximum number of contestants.
1. **Define the problem in terms of lattice points:**
   Consider the lattice points \((x,y,z)\) such that \(x, y, z \in [0,7]\) and \(x, y, z \in \mathbb{Z}\). Each lattice point \((x,y,z)\) represents a unique combination of scores for the three problems.

2. **Coloring the lattice points:**
   Color a lattice point \((x,y,z)\) red if there exists a student who got \(x\), \(y\), and \(z\) as their scores for the first, second, and third problems, respectively. The problem condition states that if \((x,y,z)\) is red, then \((x,y,k)\), \((x,k,z)\), and \((k,y,z)\) are all not red for \(0 \le k \le 7\) (with the exception of when the point is equal to \((x,y,z)\)).

3. **Applying the Pigeonhole Principle:**
   Consider all lattice points \((x,y,k)\) such that \(x, y \in [0,7]\) and \(k\) is a constant. By the Pigeonhole Principle, there can be at most 8 red lattice points in any such set, because if there were more than 8, there would be at least two points with the same \(x\) and \(y\) values but different \(k\) values, which would violate the problem's condition.

4. **Calculating the maximum number of contestants:**
   Since there are 8 possible values for \(k\), and for each fixed \(k\) there can be at most 8 red points, the total number of red points (contestants) is at most \(8 \times 8 = 64\).

5. **Constructing a valid configuration:**
   To show that 64 contestants is attainable, consider the points of the form \((x,y,(x-y) \mod 8)\) where \(x, y \in [0,7]\). This construction ensures that no two contestants share the same score in more than one problem:
   - For any two points \((x_1, y_1, (x_1 - y_1) \mod 8)\) and \((x_2, y_2, (x_2 - y_2) \mod 8)\), if \(x_1 = x_2\), then \(y_1 \neq y_2\) because otherwise \((x_1 - y_1) \mod 8\) would be the same, violating the condition.
   - Similarly, if \(y_1 = y_2\), then \(x_1 \neq x_2\) for the same reason.
   - If \((x_1 - y_1) \mod 8 = (x_2 - y_2) \mod 8\), then \(x_1 \neq x_2\) and \(y_1 \neq y_2\).

Thus, this construction works and achieves the maximum number of contestants.

The final answer is \(\boxed{64}\)