Problem: Professor Liyung wants to make a math club consisting of his $40$ students. But there is a problem. Every student is enemies with two other students. And no one wills to be a member of the club if any of his enemies is already a member of the club. Let $M$ be the maximum number of members the club can have. Find the sum of all possible values of $M$. (If student $A$ is an enemy with student $B$, then student $B$ is an enemy with student $A$.)
This is a problem from a local math contest in my city held on last month. Here is the solution I think of :
My thoughts: For every student chosen to be in the club, two students can't be a member of the club. So, the maximum number of members of the club is $20$.
I'm confused of the statement "Find the sum of all possible values of $M$" as there is only one value of $M$ in my solution. And I also believe that the problem would not be so easy as this was the second last problem in the contest and most of the problems there were not easy. But I couldn't think of other solution to the problem.
So, I want to know if my solution is correct or not. If not, what is the correct solution?
Update: A generalization to this problem has been discussed here.