import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
publicclass Main {
publicstaticvoid main(String[] argv) {
List<String> list = new ArrayList<String>();
list.add("A");
list.add("2");
list.add("c2");
System.out.println(countDistinctElements(list, 0, list.size()));
}
staticint countDistinctElements(List source, int position, int count){
List list = source.subList(position, position + count);
Set set = new HashSet();
set.addAll(list);
return set.size();
}
}