The ration is 3:5. The 3 is the empty spaces which is 27. In order to simplify 27 to 3, you have to multiply it by 9. Knowing you have to simplify both sides by the same number you then multiple the 5 by 9 getting 45. The total amount of taken spaces is 45. Add the amount of empty spaces and taken spaces together you get 72 spaces total.
You know that 58% of the chocolate bar is cocoa and it weighs 57 grams. All you have to do is multiply 0.58 and 57 together. This will give you the amount of grams of cocoa!