Log count with project automation

hi team,

in my jira, bugs links to epic as attached. i want to count the of bugs link to epic and fill in the count in field “activity number”.
in project automation, my question is i have no idea about how to calculate the count. can you help?

my rule attached