We already know the Mediterranean diet does amazing things for the heart. Now, research confirms that a menu full of fish, fruits, veggies, nuts, and olive oil and low on processed foods, red meat, and dairy also keeps the brain firing full-tilt – as long as you really stick to it.

In a new study of 17,500 people – the largest trial ever to evaluate how food impacts brainpower – the more closely participants followed the Mediterranean diet, the better their memory and thinking abilities. Those who adhered to this style of eating had a 19 percent less chance of developing cognitive problems than those who maybe ate the occasional apple or salmon fillet, but mostly chowed on less-healthy grub.

"The Mediterranean diet offers many nutrients that are crucial to brain health," says Dr. Dennis Goodman, director of integrative medicine at New York Medical Associates, which was not involved in this study. "Most important are the high-quality, healthy fats found in nuts, seeds, olive oil, fatty fish such as wild-caught salmon, grass-fed beef, and pastured poultry and eggs. This diet has the correct ratio of omega-3 and omega-6 fatty acids, which is vital for optimal brain function. It's also full of antioxidants, which reduce inflammation and thereby improve brain function."

Remarkably, these results were consistent across all study participants, regardless of age, race, demographics, and other health issues – except for one caveat: People with diabetes didn't glean the same brain benefits from the Mediterranean diet. The researchers aren't exactly sure why, but they have a few theories. For one, according to lead study author Dr. Georgios Tsivgoulis, issues that usually go along with diabetes, such as hypertension and other vascular complications, may block the diet's potential brain benefits. "These factors have been documented as the strongest predictors of dementia among diabetics, and they may have overshadowed the association of adherence to the diet and cognitive impairment in our study," Tsivgoulis says.

Besides all the brain and heart perks, the Mediterranean diet is packed with foods that actually taste great, fill you up, and don't deprive you of certain nutrients. That's a far cry from past "healthy" diets – Atkins, anyone? – that were too limiting and therefore tough to stick to. But since many components of the Mediterranean meal plan are higher in calories and even fat (although it's good fat), Goodman says to make sure you're not exceeding your recommended daily caloric intake, which is about 2,500 calories per day depending on your height and weight.