how to count how many checkboxes has selected?

how to count how many checkboxes has selected?

hi!

need count how many checkboxes has selected in entry
it will work at "on edit - on success"

how to make it?