Find the number of students in the class using CL

I’m building an activity where some computations will depend on how many students are in the class, and I don’t want to have to edit it every time just to update the number of students who are currently in the activity. Is there a way to tell how many students are in the class using CL?

To find out how many students are currently in the class, you can do:

length(aggregate(1))