According to the procedure shown in the picture, all the steps are correct and so is the answer.
The correct way to proceed is to add the frequencies of the asked colors and then divide it by the total number of data, which is what has been done.
It means that the answer is correct.