Help finding wa

question->CodeChef: Practical coding for everyone
CodeChef: Practical coding for everyone

Check for this testcase
1
5 1
1 2 2 3 3
Your output - 5
Correct Output - 3