Staying fit not only adds years to your life, but also plenty of dollars to your wallet, finds a new study published Wednesday in the Journal of the American Heart Association.

Researchers pored through data from an earlier nationally representative survey of some 26,000 Americans over the age of 18. After accounting for people who were unable to exercise regularly, pregnant, or underweight, they found a consistent pattern: People who said they met the recommended criteria for moderate to vigorous exercise on a weekly basis on average paid less in medical expenses annually than those who didn’t. The largest savings could be seen with people who had a history of cardiovascular disease — they paid around $2,500 less in medical costs compared to their counterparts who worked out less.

“Even among an established high-risk group such as those diagnosed with heart disease or stroke, those who engaged in regular exercise activities reported a much lower risk of being hospitalized, (having) an emergency room visit and use of prescription medications,” said study senior author Dr. Khurram Nasir, director of the Center for Healthcare Advancement & Outcomes and the High Risk Cardiovascular Disease Clinic at Baptist Health South Florida, in a statement.

Exercisers who were already in relatively good health with no preexisting chronic conditions also received a discount. They spent around $500 less annually compared to similar non-exercisers. Though they had lower savings, these healthier individuals spent less on medical costs to begin with compared to heart and stroke patients. Approximately one-half of the former group reported regular exercise vs one-third of cardiovascular disease patients.

Collectively, the researchers estimated that if just 20 percent of currently loafing cardiovascular disease patients began exercising regularly, the country would save billions of dollars annually in medical costs. Regular exercise is defined as 30 minutes of moderate-intensity aerobic activity 5 days a week, or at least 25 minutes of vigorous aerobic activity 3 days a week, according to the American Heart Association

For all the hopes of miraculous life-extending medical treatments, it seems that a brisk jog or walk three to five times a week is essential to creating a well-lived life.

“The message to the patient is clear: There is no better pill in reducing the risk of disease and healthcare costs than optimizing physical activity,” Nasir said.

Source: Nasir K, et al. Journal of the American Heart Association. 2016.