def count_particles(particles):
    """Count particles in each class."""
    total = len(particles)
    class_indices = particles.value_counts().index
    particle_counts = particles.value_counts()
    fractions_of_total = particles.value_counts(normalize=True) * 100
    return total, class_indices, particle_counts, fractions_of_total