The ex-pat lifestyle is growing in popularity with America’s retirees. In 2016, over 400,000 retired Americans lived overseas, a figure that’s grown almost 20% since 2010. And Latin American countries have a special appeal for their high quality of life, low cost of living, and ease of traveling “home” to visit loved ones.

It’s no wonder that places like Peru, Ecuador, Colombia, Panama, Nicaragua, and Costa Rica consistently rank in the top 10 countries for retiring seniors. But what happens when you need healthcare?

If you’re an ex-pat (or considering the ex-pat lifestyle in retirement), here’s the scoop on Medicare coverage when you live in a foreign country.

Does Medicare Cover Healthcare Outside the U.S.?

If you’re enrolled in Original Medicare (Part A and Part B), the simple answer is no. There are some extremely narrow exceptions to this rule—such as if you’re traveling through Canada on a direct route from Alaska to the lower 48 and you have a medical emergency and the nearest hospital that can treat you happens to be in Canada. In that situation, Medicare will pay for your care.

But in just about every other situation when you’re on foreign soil, your Part A and Part B benefits won’t really help.

How About Medicare Supplement Plans?

Medigap plans are great if you are traveling overseas—plans C through F provide up to $50,000 in lifetime emergency care benefits when you’re traveling outside the country.

The key words here, though, are traveling and emergency. Your international benefits only work for the first 60 days of any foreign trip. Go beyond 60 days, and your Medigap plan doesn’t have to pay. And it won’t cover routine doctor visits, preventive care, or anything less than a health emergency when you’re outside the U.S.

Will Medicare Advantage Cover Healthcare Outside the U.S.?

Some people really do well with Medicare Advantage plans—they have extra perks like prescription drug coverage, and routine dental and vision care benefits that make them very attractive. And some Medicare Advantage plans do cover healthcare expenses when you’re traveling in a foreign country.

But here’s the catch: If you’re outside your plan’s service area for more than six months, you’ll likely be automatically disenrolled and returned to Original Medicare.

Not all plans have the six-month rule, of course; you may be able to travel long-term and remain in your Medicare Advantage plan. You should definitely find out what your plan’s policy is for people living outside the U.S. before you decide to rely on it for healthcare as an ex-pat. In most cases, your plan won’t cover you if you’re living outside the U.S. full-time.

How Do I Get Healthcare as an Ex-pat on Medicare?

If you plan to make your home outside the U.S. in retirement, you have a few options. Some of them, of course, depend on the healthcare situation in the country where you choose to live. Generally speaking, though, these are the two most common options if you’re an ex-pat who qualifies for Medicare.

1. Enroll in Original Medicare. You will have to pay cash for urgent healthcare in your new country, but you can plan a trip to the U.S. once or twice a year for your routine and preventive healthcare services. You may also want to purchase an annual travel insurance and medical evacuation policy that covers transportation to the U.S. in the event of an emergency (repatriation).

2. Drop your Part B coverage and enroll in a public or private health plan in the country where you live. Many Latin American countries have low-cost public health insurance programs you can enroll in if you have qualifying residency status. If you don’t, you can still most likely enroll in a private health plan in your adopted country. Since Part A is premium-free for most people, you can keep it and use those benefits if you need them when you are in the United States. If you return to the U.S. permanently at some point, you can re-enroll in Part B. You may have to pay an enrollment penalty with your Part B premium if you do, however.

There’s no one-size-fits-all solution to health insurance as an American ex-pat in Latin America. But if you’re entitled to Medicare benefits in the U.S., you do have options for care even if you’re living in a foreign country. The key is understanding Medicare’s rules and limitations, as well as the healthcare system in your adopted country, and making decisions that work for your situation.

Danielle K Roberts is the co-founder of Boomer Benefits where her team helps baby boomers navigate Medicare.