In a competition of 50 professional ballroom dancers, 22 competed in the fox-trot competition, 18 competed in the tango competition, and 10 competed in both the fox-trot and tango competitions. How many dancers competed in either the foxtrot or tango competitions?