A really easy, fast way that I can think of giving you that, is by creating a block and passing the id of the record/records that you are displaying. And inside of the webblock you are counting with a data action how many records there are. And then you put on an expression the return value from the data action.
By doing that you are doing what you want.
EDIT:
Bruno Freitas's solution is the best in this case.
Kind Regards,
Márcio