OPTSORT - Editorial

My solution seems good to me still not aware why it showed WA. Can somebody tell me failing example?

7
4 3 2 7 1 6 5

Your Output- 8
Correct- 6