| $A$ | $B$ | $C$ | $D$ | $E$ |
| :--- | :--- | :--- | :--- | :--- |
| $E$ | $D$ | $C$ | $B$ | $A$ |
| $F$ | $F$ | $F$ | $F$ | $F$ |$+$

A fragment of a conversation on the beach:

Feri: Don't rush me now, I need to write digits here instead of the letters (Fig. 1), so that the addition is correct, the same digit for the same letter, and different digits for different letters. - Gyurka (after looking at the problem): What's the fuss about this? I can write down 77 solutions for you. - F: I doubt that. - Gy: I'll buy you as many ice creams as the number of solutions you miss, just come and swim now. - F: I'll go, but is the bet on? - How did the bet turn out?
In the column of the thousands place value, the sum of $A+E$ does not reach 10, even with any carry-over from the thousands column. In the units place value column, the sum $A+E$ is the same, so there is no carry-over from here, $A+E=F$, and on the other hand, there is no carry-over from the thousands column. Therefore, the addition is correct even if we omit the two extreme columns.

Repeating our reasoning for the remaining 3 columns, we similarly get $B+D=F$, and finally, with another omission, $C+C=2C=F$.

According to the last finding, $F$ is an even (and less than 10) number, and due to the three findings and the distinctness of the digits, no digit is 0. The value of $F$ is greater than each of the other five digits, so it must be at least 6. Thus, when searching for all solutions, we must take 6 and 8 in turn for $F$.

When $F=6$, $C=3$. The value of $A$ can be filled in 4 ways from the remaining digits $1,2,4,5$. The choice of $A$ already determines $E$, because $E=6-A$, and all 4 digits have a pair that complements them to 6. The sum of the remaining two digits is also 6, so they are suitable for $B$ and $D$, and the value of $B$ can be chosen in 2 ways. Thus, when $F=6$, the filling can be done in $4 \cdot 2=8$ ways.

When $F=8$, $C=4$, and from the digits 1, 2, 3, 5, 6, 7, the value of $A$ can be chosen in 6 ways, and the value of $B$ in 4 ways, similar to the previous case. These already determine $E=8-A$ and $D=8-B$, so there are $6 \cdot 4=24$ solutions in this case.

According to all of this, the diagram can be filled in 32 ways, and Gyurka owes Feri 45 ice creams.

Kovács Tamás (Győr, Benedek-rendi Czuczor G. g. I. o. t.)