Renaming with sub folders help

I think my Unique Numbers script already does what you want.