The rule for counting ballots with stuff like that is that once you reach a rank with multiple candidates, the ballot doesn't count.
So a ballot that says Alice #1, Bob #2, Christine #2, David #3 will count towards Alice until she's eliminated, and after that will not count.