Integrate number of participants calculation in CSV file generation