There are $2024$ people, consisting of knights and liars, and some of them are friends. Each person was asked how many friends they have, and the possible answers were $0, 1, \ldots, 2023$. Every knight answered truthfully, while every liar altered the real answer by exactly $1$. What is the minimal number of liars?

Let's think step by step and output the final answer within \boxed{}.
user