Here's an example solution. I'm not certain how you set up the dropdown to repeat, so I'm presuming that there is a subform that contains the dropdown list each time it is repeated.
var apples = oranges = pears = 0;
var lists = xfa.resolveNodes("sfSomething[*].ddFruit"); //sfSomething is the repeated subform that contains the dropdown list ddFruit
for (i=0; i<lists.length; i++){
apples = apples + (lists.item(i).rawValue == "apples"); //if the dropdown is "apples" +1 otherwise +0
oranges = oranges + (lists.item(i).rawValue == "oranges");
pears = pears + (lists.item(i).rawValue == "pears");
}
tfApples.rawValue = apples;
tfOranges.rawValue = oranges;
tfPears.rawValue = pears;