Base Report "countif"

I’ve created a query in order to use it in a report.
Something like that:

LASTNAME | FIRSTNAME |...|GENDER|... 

I cannot figure out how to add in the footer the number of Males/Females.
I want to create that:

Male: 41

Female: 24

Is it possible?

tia,
sevag

I don’t know if it the best way to do, but I solve that by adding 2 more columns in my query

if( "part"."gender" = "M", 1, 0 ) as "male"
if( "part"."gender" = "F", 1, 0 ) as "female"

and accumulate them in the created report.