That could be done with a rename script but I don't think there is an existing one which does exactly that.
It's quite similar to the Add a Unique Number while renaming script so that would be a good starting point, if you're familiar with VBScript. It'd have to be changed to reset its count for each directory.