I have a table with two columns, ID and Gender as below

I am trying to count the number of males and females. I wrote a code like this
Proc Freq data=Work.Test1; tables gender; run;
The output i got was 5males and 2 females, I know this is wrong because Id repeats many times , there are only 2 males and 1 female. My question is how do i change Proc Freq so that I get the count for gender (males and Females) for unique Id values ?