How to limit the number of jumps

I am making an audio only endless runner where obstacles come at the player while emitting a sound, like sonar. However, the way the code works now the player can infinitely jump (not vertically but along the path) by constantly clicking or hitting the space bar.

I am trying to find a way to restrict the players jumps to something like 3 and then resetting it after they have passed the obstacle.

Thank you for your help.

if (Input.GetKeyDown(KeyCode.Space) || Input.GetMouseButtonDown(0)){
			if (grounded) {
				myRigidBody.velocity = new Vector2 (myRigidBody.velocity.x, jumpForce);
			}

Create a trigger above the obstacles that detects the player then sends an event to the player that resets the jumpcount variable back to 0

public class Player : Monobehaviour
{
    int jumpCount = 0;


    void Update()
    {
        if (Input.GetKeyDown(KeyCode.) && grounded && jumpCount < 3)
        {
            //jump
        }
    }

    public void ResetJumpCount()
    {
        jumpCount = 0;
    }
}

public void ObstacleTrigger : MonoBehaviour
{
    void OnTriggerEnter(Collision coll)
    {
        if (coll.gameObject.GetComponent<Player>())
        {
              coll.gameObject.GetComponent<Player>().ResetJumpCount();
        }
    }
}

Assets\playermovement.cs(39,39): error CS1001: Identifier expected

help