Rmarcil
Create Metrics grouping using following
(.*)\|Custom Metric Process \(Virtual\)\|Custom Metric Agent \(Virtual\) [^\|:]+
Enterprise Manager\|Connections:Number of Agents
and by using above metrics grouping create a calculator "Total Number of Agents". In operator field chose sum and for metrics type use counter. you will find total Number of agents under calculator folder.