I think failing three classes in ms1 can hurt if it goes in your transcript. Preclinical grades for IM are much less important than clinical grades (especially in IM). What you need to do from now on try not to fail any more courses, just try to sneak by and just get the "p" you need. You can get into a strong IM program without honoring any preclinical courses. Try to work hard for step I and shoot for ~220 or higher. Definitely work hard in your clinical years and get decent grades and LORs. If all else checks out I think the adcoms would be willing to forgive those F's and look at the rest of your app. IM in recent years has become somewhat more competitive than before so getting into an above average academic program will require a decent step I score, clinical grades/evals, lor's. An away rotation at a program of your choice in 4th year can help you tremendously in securing a residency there. Good luck!