Cersei gave a total of 5 x 2 = <<5*2=10>>10 cotton candies to her brother and sister.
So, the total cotton candies left were 50 - 10 = <<50-10=40>>40.
And she gave 1/4 x 40 = <<1/4*40=10>>10 cotton candies to her cousin.
So, the total number of cotton candies left was 40 - 10 = <<40-10=30>>30.
Therefore, the total number of cotton candies left after she ate 12 of them is 30 - 12 = <<30-12=18>>18.
#### 18