How do I count the amount of layouts in a dwg?

Use the layout manager object in python. You can see this used in the python script i wrote here. Sheet Set - Replace specific block on each sheet with a new block - #12 by WrightEngineering