Running is the perfect activity if you want to clear your head. It's also, apparently, a great way to build bone. A new study in the European Journal of Applied Physiology suggests that training for a race can help promote bone density and stiffness, which, in turn, might help prevent osteoporosis as you get older. Got your sneakers on yet? Related: How Marathon Running Changes Your Brain More specifically, the researchers looked at bone density among 122 marathon runners, as well as 81 half-marathon and 10K race runners, and compared their bones with those of 75 non-active people. They found that the runners had much higher bone density and stiffness than the non-runners. Beyond that, those who trained for longer distances had denser bones than those who ran shorter distances. Related: 11 Science-Backed Reasons Running Is Really Good For You While you might not be super concerned about your bone health right now, you should know that bone mass can start to decline as early as age 30 — but exercise is one of the best ways to "bank" bone mass now so that your bones stay strong as you get older. That said, if you do decide to sign up for that race, be weary of doing too much, too fast: Overtraining can lead to stress fractures and other injuries. And if you simply hate running, no worries — low-impact, weight-bearing exercises like yoga and Pilates, or using the elliptical, can provide similar bone benefits. Click through to Shape for more on the long-term benefits of having a healthy lifestyle, now. Related: 8 Common Running Myths, Busted!