The best way to stay sharp in your later years could be to make sure that you're active earlier in life. At least that was the case for 800 women in a study that spanned over four decades. Both mental activity and physical activity were found to serve as a hedge against dementia.

The study followed 800 Swedish women for 44 years. At its start, the women, who averaged 47 years old, were questioned about their physical and mental activities and given scores for both based on how active they were.

Only 17 percent of the Swedish women were categorized as physically inactive, a much lower figure than has been found in some studies of people in the United States.

Women with a high level of mental activity were 46 percent less likely to develop Alzheimer's disease and 34 percent less likely to develop dementia overall compared to women with a low level of mental activity. Most encouraging is how simple the activities that help maintain your cognitive abilities can be. They ranged from playing an instrument to gardening to reading and writing.

“It's exciting as these are activities that people can incorporate into their lives pretty easily and without a lot of expense,” the study's lead author, Jenna Najar of Gothenburg University, said in a statement.

Yes, tickets to the opera or a rock concert can be expensive, but visiting a museum, playing an instrument, dancing or just reading are pretty easy to fit into a tight budget.

Women who had a high level of physical activity were also less likely to develop dementia. Active women were 52 percent less likely to develop dementia or stroke and 56 percent less likely to develop dementia that could be traced to multiple causes — including Alzheimer's disease — than women who were physically inactive.

Mental activity was measured by giving participants scores of zero to two in five different areas: intellectual activities, such as reading and writing; artistic activities, such as going to a concert or singing in a choir; manual activities, such as needlework or gardening; club activities; and religious activity. The maximum score was 10.

The low mental activity group consisted of women with total scores of zero to two, while the high activity group had scores of three to 10.

When it came to physical activity, people were classified as either active or inactive. To qualify as physically active, people needed to perform four hours per week of light physical activity, such as walking, gardening or biking, or regular intense exercise such as running or swimming.

Interestingly, only 17 percent of the Swedish women fell into the physically inactive group, a much lower figure than has been found in some studies of people in the United States.

The study appears in Neurology.