MSD of sulphonated carbon groups

Hi,

How to find MSD of sulfonated carbon and non-sulfonated carbon groups in a Sulphonated polystyrene polymer system using Gromacs?

Regards,
Prisi