Depending upon your UC GPA, test scores, essays and EC’s, it may be possible to get into UC Merced if you meet the a-g course requirements. If you do not retake AP Biology and AP Env Sci, your F and D will be used in the UC GPA calculation. Here is UC Merced’s Freshman profile:
GPA and test scores of middle 25%-75% students
High School GPA: 3.37 - 3.88
ACT Composite Score: 19 - 27
SAT Critical Reading: 450 - 580
SAT Mathematics: 470 - 620
Going to a CC if you plan to apply to Medical School will not be as detrimental to your chances as much as you think. There are many examples of applicants that took that route.