What function should i use to instantiate only one object per click?

I want to use this script to instantiate an object. If i use it in void update() it spawns too many at a time. What should i do? I m still learning unity.

      if (Input.touchCount >= 1) 
	{
		spawnatclick ();
	}
		
}
void spawnatclick()
{
		Instantiate (pinPrefab, transform.position, transform.rotation);

}

You can copy the code from the link. In your case, you want to use the Began phase.