Determines the number of each base in orders