PORTSMOUTH, Va (WAVY) — Toilet habits are an awkward topic, but if you want a healthy brain listen to this: constipation could be linked to dementia.

New research released today at the Alzheimer’s Association International Conference found chronic constipation was tied to worse cognitive abilities, by the equivalent of three years of aging. It is one of several studies tying gut health to brain health.

“It seems the quality of the bacteria in our intestinal tract and the frequency of elimination may be connected to what is absorbed and may eventually impact the health of the brain,” said Rita Smith, a registered dietitian at Sentara Martha Jefferson Hospital in Charlottesville.

If you’re only going number two every three days or more, scientists believe bad bacteria could be building up.

“There are a number of things that get into our system through our intestinal tract,” Smith said. “It could be chemicals, it could be preservatives. I don’t think we’re there yet to identify exactly what’s going on.”

As scientists begin to study this gut brain connection more, Smith recommends you ditch the junk food. Heavy preservatives and very salty foods she said kill good bacteria. An excessive amount of alcohol will do the same.

If you have chronic constipation, Smith advises you to check with your doctor. It could be related to a medication you take. Also, she said, make sure you’re getting enough fluids and fiber.

“If you’re having cornflakes in the morning, can you have a raisin bran? If you have a sandwich on white bread at lunch, can you switch the bread to a whole grain? Can you add a cup of vegetable soup at the same time?”

Feeding your gut healthy bacteria is just as important. Smith says you should aim for 30 different fruits and vegetables over a week.

“You want a diverse amount, not just always an apple and a banana or green beans and corn,” Smith said, “because each part of the produce group has different features and benefits.”

Two other studies presented at the Alzheimer’s conference also found specific gut bacteria were associated with an increased risk of dementia.

Read more about the presentations at the Alzheimer’s Conference here.