“count_atoms” returns a count of atoms in a selection.
count_atoms (selection)
cmd.count_atoms | commands