Help with Puchi and Luggage

I am trying to understand this problem: Puchi and luggage. I understand that it is using Inversion Count of merge sort. But here, in author’s solution, I don’t understand why the Frequency array is updated twice where as it should be updated only once during merging…

Its better if you copy paste authors solution here. People who didnt solve the problem dont have access to it. Pasting it here will make it available to anyone willing to help.