Given a set $A$ which contains $n$ elements. For any two distinct subsets $A_{1}$, $A_{2}$ of the given set $A$, we fix the number of elements of $A_1 \cap A_2$. Find the sum of all the numbers obtained in the described way.
1. **Counting the ways to choose common elements:**
   - There are $\binom{n}{i}$ ways to choose $i$ common elements of two subsets $A_1$ and $A_2$ from the set $A$.

2. **Defining the remaining elements:**
   - Let $C = A_1 \setminus (A_1 \cap A_2)$ and $D = A_2 \setminus (A_1 \cap A_2)$. 
   - Then $|C \cap D| = 0$ and $|C \cup D| \le n - i$.

3. **Counting the pairs $(C, D)$:**
   - There are $\binom{n-i}{l} 2^{n-i-l}$ ways to choose pairs $(C, D)$ such that $|C| = l \ge 1$.
   - For $l = 0$, the number of ways is $\binom{n-i}{0} 2^{n-i} - 1$ (subtracting 1 to exclude the case $|C| = |D| = 0$).

4. **Summing the pairs $(C, D)$:**
   - The total number of pairs $(C, D)$ is:
     \[
     \frac{1}{2} \left( \sum_{l=0}^{n-i} \binom{n-i}{l} 2^{n-i-l} - 1 \right) = \frac{1}{2} (3^{n-i} - 1).
     \]
   - This is because each element in the remaining $n-i$ elements can either belong to $C$, $D$, or neither, giving 3 choices per element, hence $3^{n-i}$ ways in total. We subtract 1 for the case $|C| = |D| = 0$ and divide by 2 since the order of $(C, D)$ does not matter.

5. **Calculating the desired sum:**
   - The desired sum $S$ is:
     \[
     S = \sum_{i=1}^n i \binom{n}{i} \cdot \frac{1}{2} (3^{n-i} - 1).
     \]
   - Simplifying, we get:
     \[
     S = \frac{1}{2} \sum_{i=1}^n i \binom{n}{i} (3^{n-i} - 1).
     \]
   - Using the identity $i \binom{n}{i} = n \binom{n-1}{i-1}$, we have:
     \[
     S = \frac{n}{2} \sum_{i=1}^n \binom{n-1}{i-1} (3^{n-i} - 1).
     \]
   - Changing the index of summation, let $j = i-1$, then:
     \[
     S = \frac{n}{2} \sum_{j=0}^{n-1} \binom{n-1}{j} (3^{n-1-j} - 1).
     \]
   - Splitting the sum, we get:
     \[
     S = \frac{n}{2} \left( \sum_{j=0}^{n-1} \binom{n-1}{j} 3^{n-1-j} - \sum_{j=0}^{n-1} \binom{n-1}{j} \right).
     \]
   - Using the binomial theorem, $\sum_{j=0}^{n-1} \binom{n-1}{j} 3^{n-1-j} = 4^{n-1}$ and $\sum_{j=0}^{n-1} \binom{n-1}{j} = 2^{n-1}$, we get:
     \[
     S = \frac{n}{2} (4^{n-1} - 2^{n-1}).
     \]
   - Simplifying further, we obtain:
     \[
     S = n \left( 2^{2n-3} - 2^{n-2} \right).
     \]

The final answer is $\boxed{n \left( 2^{2n-3} - 2^{n-2} \right)}$