Only execute command on second collision

Is there way to execute a command only on the second time that the gameobject collides?

Have a variable that starts at zero. Increase it by one when the game object collides. When this variable reaches 2, then execute your command.