A selection of frames

I don’t know how to set a selection of frames to the action gotoAndplay. I would like it to go to a random frame within a settled range. As for instance a random frame of frames 1; 12-15; 20-27. (1;12;13;14;15;20;21;22;23;24;25;26;27)

I know that to make it go to a random frame within 12-15 I have to put random(4)+12

But how to make it go to a random frame within two selections or two frames that don’t follow each other like 1; 12-15; 20-27

thanks, gustav