actually the payback is for both the scholarship and the residency. the trick is that you can pay them back simultaneously, tho. so in the end you will serve the # of years you received the scholarship (HPSP) or did you residency, whichever was longer. i think you also get some years in the Inactive Ready Reserve, too, but not like there's a huge likelihood of getting called up from the IRR. the thing to watch for is if you don't go straight to residency after medschool. if, for instance (in the Navy especially), you do a 4 year scholarship then a 2 year tour as a GMO, you paid back 2 years of the 4 for your scholarship. then you go to residency for 3 years. after residency you'll owe 3 years still (for the residency, during which you'll simultaneously pay back the 2 remaining years of service for the scholarship).
look at other threads about this, but the final word is usually that if you want to join the military, regardless of what they pay you, then its the right decision. if you are doing it for the money, its probably the wrong thing to do. (check out the financial aid forum for more info)
-mark
________
planning on doing HPSP or USUHS thru Navy