There's now a scientific solution for earworms, those pesky little tune fragments that take root in your head and don't easily go away.

Researchers at the University of London in the United Kingdom surveyed 18,000 residents of Finland and England and discovered three top ways people clear their systems of the often-distracting melodies.

Results of the study have been reported in the journal PLOS One.

The study found the most common ways to silence earworms were: listening to or singing the complete song or tune; focusing on another piece of music to shove the old tune out; or, simply ignoring it.

"A tune that's not too catchy itself might do the trick," said lead researcher Lauren Stewart.

The British national anthem, which Stewart noted is usually not a tune people say gets stuck in their heads, was mentioned most often by Brits as an earworm replacement.

Stewart said there were 64 specific songs overall that were mentioned as good replacement tunes, but the British anthem was the lead vote-getter, with six.

Other earworm-eradicating tunes that earn more than one vote included the standard "Happy Birthday" song and Culture Club's "Karma Chameleon," although the latter ditty has been known to plant at least a few worms of its own.

Stewart said a majority of the people who replaced one tune with another reported the second tune in fact did not become an earworm.

About one-in-nine study participants from England said they tried to distract themselves with another song, and it frequently worked.

Then again, more than half of the Finns surveyed said were more likely to embrace the song, play it over and over or listen to the end. That method also proved successful, at least some of the time, the study found.

Stewart indicated about 90 percent of people she's asked said they get earworms at various times, a result of lack of control and an idling brain.

"People get very annoyed about being made to listen to music that they find is not to their personal taste and that they cannot control," she said.