How to calculate number of each type of atom in a residue in PyMOL?
Not super elegant, but this should work:

select resn dex and symbol C


Pymol will respond,

Selector: selection "sele" defined with 22 atoms.


Repeat for H, F, O.