
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
The king decided to reward a group of \( n \) sages. They will be lined up one behind the other (so everyone is looking in the same direction), and each will wear either a black or a white hat. Each sage will be able to see the hats of all those in front of them. The sages will take turns (starting from the last one to the first) to name the color (black or white) and a natural number of their choice. At the end, the number of sages who named the color matching the color of their hat will be counted: the group will receive an additional payment in their salary for exactly that many days. The sages are allowed to agree in advance on how to respond. However, the sages know that exactly \( k \) of them are insane (they do not know who specifically). An insane sage names white or black and a number at random, ignoring any agreements. What is the maximum number of days with additional payments that the sages can guarantee for the group, regardless of the insane sages' positions in the lineup?

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