
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
Since the beginning of the school year, Andrey has been recording his math grades. Upon receiving a new grade (2, 3, 4, or 5), he called it unexpected if, up to that point, it had occurred less frequently than each of the other possible grades. (For example, if he received the grades 3, 4, 2, 5, 5, 5, 2, 3, 4, 3 in order, the first 5 and the second 4 would be unexpected.) Over the entire school year, Andrey received 40 grades - exactly 10 fives, 10 fours, 10 threes, and 10 twos (the order is unknown). Can you definitively determine the number of grades that were unexpected for him?

Present the answer in LaTex format: \boxed{Your answer}
user