create a shared variable and increment it accordingly in the detail section. Display it in the group footer and set it to 0 in the group header. If you only need the results on the data line, just create the formula and drop it on the line...but usually someone will want to see a total, and the shared variable will do that for you.
HTH