\newcounter

\newcounter{foo}[counter]

The \newcounter command defines a new counter named foo. The optional argument [counter] causes the counter foo to be reset whenever the counter named in the optional argument is incremented.