A kindergarten received cards for reading lessons: some have "MA" written on them, and others have "NYA".

Each child took three cards and started forming words from them. It turned out that 20 children could form the word "MAMA", 30 children could form the word "NYANYA", and 40 children could form the word "MANYA". How many children have all three cards the same?

#
Notice that each child has three cards, and there are two different inscriptions on them.

## Solution

Since each child has three cards, and there are only two inscriptions in total, it is necessary that two inscriptions must match, meaning each child can form either the word MAMA (20 such children) or the word NYANYA (30 such children). Therefore, the total number of children is 50. If a child has all three cards the same, they cannot form the word MANYA (there were 40 such cases). Therefore, three identical cards are held by $50-40=10$ children.

## Answer

10 children.