You already know walking is good for your heart, losing or maintaining weight and your mood, but it can also yield mental benefits. From preventing dementia to improving memory, there are several science-backed benefits of lacing up your walking shoes.

Here, a look at four of the brain health benefits and how much walking you need to do to achieve them.

IMPROVES COGNITIVE FUNCTION

Being physically active is associated with increased cognition and a lower risk of dementia. Researchers often study the effects of walking on older adults who are at risk of cognitive decline. “Exercise gives more benefit than brain puzzles,” says Dr. Hyun-Sik Yang, neurologist at Brigham and Women’s Hospital in Boston and instructor at Harvard Medical School. “There has been a recent clinical trial showing the benefit of intense lifestyle modification, including exercise, in preventing cognitive decline in at-risk population. This was done in Finland, and the Alzheimer’s Association is planning a U.S. version of the study.”

Other research shows young adults who exercise regularly may lower their risk of cognitive decline and dementia in old age. “Benefits of physical activity are not bound by age groups,” says medical exercise specialist Chris Gagliardi, a spokesperson for the American Council on Exercise. “Younger adults and youth also realize improved cognitive function with physical activity.”

BOOSTS BLOOD FLOW TO THE BRAIN

Researchers at New Mexico Highlands University found when you walk, the impact of your feet hitting the ground causes waves of pressure which send more blood to the brain than when you’re standing still. Researchers believe this increase in blood flow to the brain may be associated with the feel-good “walker’s high” some people experience.

MAKES YOU A BETTER TEST-TAKER

A recent study from UCLA found older adults who walked more than 4,000 steps a day had thicker sub-regions of the hippocampus, an area of the brain associated with memory, compared to older adults who were sedentary. Walkers performed better on tests that measured their attention, information-processing speed and ability to make plans and achieve goals than non-walkers.

CONTRIBUTES TO RECOVERY

Your body recovers from the day’s stresses overnight while you sleep. Being well-rested helps maximize your cognitive function; when you’re sleep-deprived, your brain doesn’t fully recover, putting you at a deficit. Getting enough exercise makes it easier to fall asleep, ensuring better brain recovery at night: A recent British study found sedentary people with insomnia, who increased their physical activity to 30 minutes a day of brisk walking, improved their sleeping habits.

“Physical activity improves sleep efficiency and sleep quality while also reducing the need for medications to promote sleep,” Gagliardi says.

HOW MUCH WALKING IS ENOUGH?

Most people should boost brain health by walking moderately for 30 minutes daily, says Gagliardi. Pace matters; walk briskly, rather than meandering slowly, for the greatest benefit. “Breaking into a sweat or feeling winded while walking is a good indicator,” says Yang, who encourages people to walk as much as they can, even if they can’t go for half an hour. “A little bit of exercise is far better than none. So 30 minutes is a goal, but you can start out with 5 minutes, 10, 15 and build from there.”