A new study suggests that people who often eat fruits and vegetables are able to preserve their memory and thinking skills 25 percent longer than those who consume unhealthy food.

Researchers at the McMaster University in Hamilton, Ontario, Canada looked at the data of more than 28,000 older adults from 40 countries for the study. They compared the mental performance of the participants with their diet.

The team devised a "healthy eating" index and then categorized the participants according to the type of food they regularly consume. One gets a high score if he or she regularly eats fruits and vegetables and gets a low score if he or she often consumes fried foods. The participants also underwent a series of cognitive assessments to monitor brain power in the beginning, middle and end of the study.

The analysis showed that those who scored highest in the "healthy eating" index have the lowest memory decline at 25 percent compared to those who regularly eat red meats and sweets. They also found that the healthy eaters are four percent better in thinking skills compared to those who make unhealthy food choices.

The researchers clarified that their study does not recommend any particular diet.

"The difference in our study is we didn't prescribe a particular diet or explore for a particular diet pattern," Andrew Smyth, study lead author of the study and a nephrologist at McMaster University, told CNN.

"We just wanted to look at a diverse cohort of people from all around the world and analyze what their risk for cognitive decline would be if they consumed what most organizations would consider a 'healthy diet'," he added.

The researchers admitted that further research is needed to determine how the healthy diet aids in preserving memory and thinking skills. Smyth believes, though, that it could be because of the anti-inflammatory nutrients in foods like fruits, vegetables and fish that help preserve brain health, according to HealthDay News.

The study was published in the May 6 issue of Neurology.