Don't get offended, DarkAngelAzazel, the guy just tried to help.
I shall add that counting buildings is very tricky, since you have to modify values when a building is destroyed, or is built but not finished, or canceled, etc. This thing 1) leaks a lot 2) isn't trustworthy, I tried it myself and 3) is glitchy, because the game sometimes misses buildings, dunno why. I tried to use this method to create my V/D conditions for custom races. It sucks.