So here's a funny thing: I have 3 Fs and 1 D on my transcript, but my GPA is ~3.8, which is "high" because I double majored in math and computer science. The reason for those 4 bad grades is that I had 2 bad semesters where I suffered from depression; I didn't drop the classes before the deadline so I ended up failing the classes. However I retook the classes and got As in them (hence my GPA), and in fact got A/A-s in all subsequent classes (quite an improvement). I plan to apply to a master's for computer science, and eventually a phd. However I know the admission officers eyes will bleed when they see my transcript, despite my GPA, because my school keeps ALL grades on transcripts, even if the grades were replaced by retaking classes. Do I still have a chance at top-10 graduate school for computer science even with these grades (which were retaken and then aced)?
In my (rather extensive) experience with graduate admissions, admissions committees understand that people have semesters in which life interferes with school. If you've retaken the classes and received high marks in them, this very clearly signals that something was interfering with your performance during those two semesters and that the bad grades have nothing to do with your underlying ability. Those grades won't go unnoticed -- but nor will they hurt you the way they would had you not repeated and aced those courses.
It would help further if you have a trusted mentor who could mention and--to the degree that you comfortable, explain--this issue in his or her letter of recommendation.
Don't count on cruising through the application process, but also don't lower your ambitions based on these grades.
As a former member of a graduate program committee who has reviewed hundreds of applications I can give my opinion. Address the F's directly and briefly in your application letter, say you had a problem, point out the retakes, and tell them you learned from the experience.
I personally have three advanced degrees and a few F's on my undergraduate transcript.
"Experience is a hard teacher because she gives the test first, the lesson afterward." - Vernon Law
My experience was very similar to yours. I had four F's an a D (or two) from when I abruptly dropped out years before. My GPA was ultimately 3.5, with a 3.95 in CS at a middling school. That, along with enthusiastic (but not particularly high quality) references got me into a few good schools -- I ended up going to one in the top five. You should note though that there are two types of masters programs: project-based and research-based. Project-based, which is what I did, are much easier to get in to. They are for students who want to get a masters and get out. Generally they will not be funded. A research-based masters is for students who intend to go on to get a PhD. They are generally much more difficult to get into and often are funded. If you find you are having trouble getting into a PhD or masters->PhD program, you might want to look into a project-based program with a good school. You might be able to work on something with a prof you like and get into the PhD program on their recommendation. I've seen it happen several times.
ETA: Remember, the main thing admissions people are interested in is the last thing you did. So if you find you can't get into the best PhD program, go to whatever place best fits your interests (that you can get into, of course) and put together some quality research. No one will care what you did in undergrad.
It also depends on the academic reputation of your undergraduate school. Is it a widely appraised school? You should be fine as long as you have a 3.5 or higher, and decent GRE scores (generally 1100 and higher). Top 10 is very ambitious! They will look over your transcript, and degree of difficulty of your classes you've taken. Also they will take into account how well you did in the last few semesters. If you have gotten A's in the last few semesters, it's good indication that you'll do well in grad school, in their opinions.