I knew some from my friends' cases, but I read a little more about it because I didn't know for sure. Apparently the Naval Academy limits the number who can go to med school right out of college at 2%. One of my friends served first, so he didn't have an obligation, but he got his med school covered afterward and had some kind of obligation in the reserves -- not sure what it was because he was planning on doing reserves anyway. My other friend went to an Ivy med school right out of college, got it covered, and collected a monthly stipend of around $2000. That added 4 years to his commitment (I think 9 total), and residency didn't count toward the obligation. He was planning to stay with the military all along, though.
If you want to be a doctor, it sounds like the naval academy is the wrong way to go, unless you want to stay with the military after. You can make enough to pay for school in less time than the commitment (usually... assuming you're not buying **** you shouldn't), and there are jobs that can pay for loans for most specialties. The VA system has a program where you can get up to $40k per year for 5 years paid without any commitment. My loans were $270k, and they're taken care of in less than 3.5 years, though about $100k of that is through employer. And you can also refinance them for a great rate these days and invest excess money and probably make more that way, just wouldn't go all in on gamestop