How do I count the number of players in a server

Hi everyone !
I am searching for hours ! I would like to know how many players I have in a server so I can limit the server' start a game when there are enough players and so on.
How can I do that ?

If not possible, how can I create a gameobject that belongs to a server and to this server I will pass some int++ as player Instantiating in to it.

Thanks !