Is there a way to count the total number of checkboxes selected?

Is there a way to count the total number of checkboxes selected?

You can achieve it with the "size()" function to get the number of check boxes selected as,

noOfOptionsSelected = input.CheckBox.size();